containerd / stargz-snapshotter

Fast container image distribution plugin with lazy pulling
https://github.com/containerd/containerd/issues/3731
Apache License 2.0
1.15k stars 114 forks source link

Support containerd config_path for registry endpoints #1647

Closed brandond closed 6 months ago

brandond commented 6 months ago

Containerd has preferred using docker-style certs.d via the CRI config_path values, since the 1.5 release. Ref: https://github.com/containerd/containerd/blob/main/docs/hosts.md#cri

[plugins."io.containerd.grpc.v1.cri".registry]
  config_path = "/etc/containerd/certs.d"

stargz should support this, instead of requiring inline config under the plugins."io.containerd.snapshotter.v1.stargz".registry.mirrors table key

Current:

[plugins."io.containerd.snapshotter.v1.stargz".registry.mirrors."docker.io"]
  endpoint = ["https://registry.example.com/v2"]

Preferred:

[plugins."io.containerd.snapshotter.v1.stargz".registry]
  config_path = "/etc/containerd/certs.d"
brandond commented 6 months ago

I guess this has actually been supported since https://github.com/containerd/stargz-snapshotter/pull/331, but I wasn't aware of that when I refactored the registry stuff in https://github.com/k3s-io/k3s/pull/8973