failed to resolve reference error for private container registries
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
Hi @developer-guy , Same issue without lima ?
Hi @developer-guy ,
Same issue without lima ?
Hello @fahedouch thanks for the quick response, nope, everything works fine on my machine 🙋🏻♂️
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?
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.
Creating
~/.config/systemd/user/containerd.service.d/override.confin the guest with the following content should work[Service] Environment=CONTAINERD_ROOTLESS_ROOTLESSKIT_FLAGS=--cidr=192.168.42.0/24The 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?