-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom registry, push error on self-signed cert #80
Comments
In my case, it wasn't a self-signed cert but a company-wide CA cert. It's very possible that CA cert wasn't present in the environment I was running buildx from though so I could look into that. |
I'm seeing similar with a standalone registry server and locally created CA/certificates. I'm able to run a |
I managed to work-around this - by adding my own CA's cert to the generated container, and restarting it.
It aint pretty, but it works! |
A marginally more robust work-around, but still not pretty (no error checking etc): BUILDER=$(sudo docker ps | grep buildkitd | cut -f1 -d' ') A possible solution/suggestion would be to allow for something like: |
as I just bumped into this issue, I'd like to add one more option instead of mangling an existing builder container. I went with the option to have a 2 line Dockerfile that adds my internal CAs to |
@fopina can you elaborate on how you did that? I have a 2 line dockerfile where I copy a cert into When I run Create and verify the image:% docker run --rm -ti testbuilder sh
INFO[0000] auto snapshotter: using native
WARN[0000] using host network as the default
INFO[0000] found worker "t3jdqv8o0ov117tdipqjmfnly", labels=map[org.mobyproject.buildkit.worker.executor:oci org.mobyproject.buildkit.worker.hostname:000f6536acfa org.mobyproject.buildkit.worker.snapshotter:native], platforms=[linux/amd64 linux/arm64 linux/riscv64 linux/ppc64le linux/s390x linux/386 linux/arm/v7 linux/arm/v6]
WARN[0000] skipping containerd worker, as "/run/containerd/containerd.sock" does not exist
INFO[0000] found 1 workers, default="t3jdqv8o0ov117tdipqjmfnly"
WARN[0000] currently, only the default worker can be used.
INFO[0000] running server on /run/buildkit/buildkitd.sock
# In a different terminal window:
% docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
000f6536acfa testbuilder "buildkitd sh" 18 seconds ago Up 17 seconds jovial_blackwell
% docker exec -it jovial_blackwell sh
/ # cd /usr/local/share/ca-certificates/
/usr/local/share/ca-certificates # ls
certs.pem using it as a builder?% docker buildx create --name tester --builder testbuilder:latest
% docker buildx use tester
% docker buildx inspect --bootstrap
[+] Building 1.0s (1/1) FINISHED
=> [internal] booting buildkit 1.0s
=> => pulling image moby/buildkit:buildx-stable-1 0.4s
=> => creating container buildx_buildkit_tester0 0.6s
Name: tester
Driver: docker-container
Nodes:
Name: tester0
Endpoint: unix:///var/run/docker.sock
Status: running
Platforms: linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
% docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d9c5e77418fc moby/buildkit:buildx-stable-1 "buildkitd" 9 seconds ago Up 8 seconds buildx_buildkit_tester0
docker exec -ti d9c5e77418fc sh
/ # ls /usr/local/share/ca-certificates/
/ # % < -- nothing here |
@bdharrington7 have you tried curl in that image (on the registry endpoint) to validate that they have been properly installed? |
I didn't try curl, but I did try using the |
Tried that, but it didn't work. |
Considering this issue has been open for over two years, I was just curious if there is an update and/or plans to address? |
Reboot fixed it for me, I'm not sure why.. |
To modify buildx builder image use |
@tonistiigi is there any documentation on how to get thos to work now? |
Hi, guys. We still hit this issue in buildx
Here is the configuration of
|
We checked all the certifications are copied into the |
More information about the token, so, we believe the token is working well.
|
Finally, we solved this issue. And there are two steps we need to confirm before we use to build:
# Execution of this command on the host
cp /home/harbor/ca/ca.crt /etc/pki/ca-trust/source/anchors/ update-ca-trust extract All things are good to go. |
This comment was marked as abuse.
This comment was marked as abuse.
can we make buildx skip verify private registry cert like docker ( /etc/docker/daemon.json insecure-registries) ? then we have no need to provide CA cert for buildx instance. |
can we make buildx skip verify private registry cert like docker ( /etc/docker/daemon.json insecure-registries) ? then we have no need to provide CA cert for buildx instance. |
1 similar comment
can we make buildx skip verify private registry cert like docker ( /etc/docker/daemon.json insecure-registries) ? then we have no need to provide CA cert for buildx instance. |
I'm locking this thread as this has been solved and recent comments are not related. |
'buildx' errors, while 'docker build' succeeds:
x509: certificate signed by unknown authority
, but certificate chain is ok.test:
: |openssl s_client -connect img.service.consul:443
[...]Verify return code: 0 (ok)
docker build
+push
works also:buildx imagetools inspect
again works:perhaps related to #57 (comment)
tested:
The text was updated successfully, but these errors were encountered: