Open nebiros opened 3 years ago
Currently, --insecure-registry
does not apply to build operations, because they are handled by buildkitd, not by containerd.
The solution is to create ~/.config/buildkit/buildkitd.toml
(/etc/buildkit/buildkitd.toml
for root) like this
# registry configures a new Docker register used for cache import or output.
[registry."docker.io"]
mirrors = ["yourmirror.local:5000"]
http = true
insecure = true
ca=["/etc/config/myca.pem"]
[[registry."docker.io".keypair]]
key="/etc/config/key.pem"
cert="/etc/config/cert.pem"
# optionally mirror configuration can be done by defining it as a registry.
[registry."yourmirror.local:5000"]
http = true
https://github.com/moby/buildkit/blob/master/docs/buildkitd.toml.md
I am using Rancher Desktop (0.7.1) on Windows 10 Enterprise (under a big company). My command (test example) is:
nerdctl build -t nginx:nerd .
with this Docker file
# Dockerfile
FROM nginx:alpine
RUN echo 'Hello Nerdctl from containerd'
Despite, I created the ~/.config/buildkit/buildkitd.toml file with the proposed content, I still get the same error:
[+] Building 0.7s (3/3) FINISHED
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 31B 0.0s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> ERROR [internal] load metadata for docker.io/library/nginx:alpine 0.6s
------
> [internal] load metadata for docker.io/library/nginx:alpine:
------
error: failed to solve: failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to do request: Head https://registry-1.docker.io/v2/library/nginx/manifests/alpine: x509: certificate signed by unknown authority
FATA[0000] unrecognized image format
I want to notice also that when I pull or run the image, it works fine.
I have the same issue.
Signing out from my company VPN fixed the issue. VPN was messing up the cert.
This issue is solved in the version v1.0.0
--insecure-registry does apply to nerdctl pull
but not apply to nerdctl build
operations
try to add buildkitd.toml for buildkitd as following
/etc/buildkit/buildkitd.toml
[registry."your-container-registry.com"]
http = true
insecure = true
and don't forget to run systemctl restart buildkit
Running:
I got this error:
Dockerfile.local
Weird this is that the
pull
command works: