nerdctl icon indicating copy to clipboard operation
nerdctl copied to clipboard

failed to resolve reference error for private container registries

Open developer-guy opened this issue 4 years ago • 5 comments

I tried to use lima + nerdctl in order to pull container images from our private Gitlab registry which serves over TLS, I got the following error:

lima nerdctl image pull registry.private.com/hello-world:release-2df9312d
INFO[0000] trying next host                              error="failed to do request: Head \"registry.private.com/hello-world:release-2df9312d\": dial tcp: lookup registry.trendyol.com on 10.0.0.5:53: no such host" host=registry.private.com
FATA[0000] failed to resolve reference "registry.private.com/hello-world:release-2df9312d": failed to do request: Head "https://registry.private.com/hello-world:release-2df9312d": dial tcp: lookup registry.private.com on 10.0.0.5:53: no such host
exit status 1
$ uname -a
Darwin C02DM1U3MD6R 20.6.0 Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:31 PDT 2021; root:xnu-7195.141.2~5/RELEASE_X86_64 x86_64
$ lima --version
limactl version 0.6.3

developer-guy avatar Sep 10 '21 08:09 developer-guy

Hi @developer-guy , Same issue without lima ?

fahedouch avatar Sep 10 '21 15:09 fahedouch

Hi @developer-guy ,

Same issue without lima ?

Hello @fahedouch thanks for the quick response, nope, everything works fine on my machine 🙋🏻‍♂️

developer-guy avatar Sep 10 '21 15:09 developer-guy

10.0.0.5

Is your host network in 10.0.0.0/8 ? That may conflict with the network of slirp4netns network used by rootless containerd. Does lima sudo nerdctl work?

AkihiroSuda avatar Sep 10 '21 15:09 AkihiroSuda

Creating ~/.config/systemd/user/containerd.service.d/override.conf in the guest with the following content should work

[Service]
Environment=CONTAINERD_ROOTLESS_ROOTLESSKIT_FLAGS=--cidr=192.168.42.0/24

The CIDR can be whatever else, as long as it doesn't conflict with your local network.

AkihiroSuda avatar Sep 10 '21 18:09 AkihiroSuda

Creating ~/.config/systemd/user/containerd.service.d/override.conf in the guest with the following content should work

[Service]
Environment=CONTAINERD_ROOTLESS_ROOTLESSKIT_FLAGS=--cidr=192.168.42.0/24

The CIDR can be whatever else, as long as it doesn't conflict with your local network.

I am using Rancher Desktop on Windows with WSL2. How can I do this fix on my setup?

strakh-alex avatar Mar 14 '22 15:03 strakh-alex