[rootless]nerdctl build fails with x509: certificate signed by unknown authority error despite insecure=true configured in buildkitd.toml
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- go
- Domain
- cli, infrastructure
Research direction
Reproduce the rootless setup with ~/.config/buildkit/buildkitd.toml, ~/.config/nerdctl/nerdctl.toml, and the registry hosts.toml, then compare nerdctl pull with nerdctl build using the supplied Dockerfile. Trace how build metadata and OAuth token requests use the registry TLS settings; done means the build succeeds without a prior pull while honoring skip_verify/insecure configuration.
Written by the indexing model from the issue text.
Description
Description
After installing nerdctl-full-2.2.1-linux-arm64.tar.gz using rootless mode, I am trying to build an image using a private Harbor registry (myregistry.com) that uses a self‑signed SSL certificate. I configured nerdctl.toml/hosts.toml/buildkitd.toml to skip TLS verification for that registry, but the build result is an error: (x509: certificate signed by unknown authority). I have read the relevant md document, but I couldn't find the cause of the problem.
Steps to reproduce the issue
1.install containerd/fuse-overlayfs/buildkit
$ containerd-rootless-setuptool.sh install
$ containerd-rootless-setuptool.sh install-fuse-overlayfs
$ containerd-rootless-setuptool.sh install-buildkit-containerd
2.config
$ cat ~/.config/containerd/config.toml
[proxy_plugins]
[proxy_plugins."fuse-overlayfs"]
type = "snapshot"
address = "/run/user/1005/containerd-fuse-overlayfs.sock"
$ cat ~/.config/buildkit/buildkitd.toml
[worker.cni]
enabled = false
[worker.containerd]
enabled = true
rootless = true
namespace = "default"
snapshotter = "fuse-overlayfs"
[registry."myregistry.com"]
http = false
insecure = true # attention this config
$ cat ~/.config/nerdctl/nerdctl.toml
namespace = "default"
snapshotter = "fuse-overlayfs"
insecure_registry = true # attention this config
hosts_dir = ["/path/to/certs.d"]
$ cat /path/to/certs.d/myregistry.com/hosts.toml
server = "myregistry.com"
[host."myregistry.com"]
capabilities = ["pull", "resolve", "push"]
skip_verify = true # attention this config
3.restart
$ systemctl --user daemon-reload
$ systemctl --user restart containerd.service
$ systemctl --user restart buildkitd.service
4.login
$ nerdctl login myregistry.com
- build and get error
$ cat Dockerfile
FROM myregistry.com/xxx/nginx:1.23.2
RUN echo "hello"
$ nerdctl build -t test-nginx:v1 .
[+] Building 0.1s (3/3) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 112B 0.0s
=> ERROR [internal] load metadata for myregistry.com/xxx/nginx:1.23.2 0.1s
=> [auth] xxx/nginx:pull token for myregistry.com 0.0s
------
> [internal] load metadata for myregistry.com/xxx/nginx:1.23.2:
------
Dockerfile:1
------
1 | >>> FROM myregistry.com/xxx/nginx:1.23.2
2 | RUN echo "hello"
3 |
------
error: failed to solve: failed to fetch oauth token: Post "https://myregistry.com/service/token": tls: failed to verify certificate: x509: certificate signed by unknown authority
Describe the results you received and expected
Actual behavior:
Without pulling the nerdctl pull myregistry.com/xxx/nginx:1.23.2 in advance, run nerdctl build -t test-nginx:v1 . with a simple Dockerfile, result is x509: certificate signed by unknown authority
Expected behavior:
Build should succeed, using the configured skip_verify = true / insecure_registry = true / insecure = true settings for the registry, just as nerdctl pull does.
Additional observations:
If first run nerdctl pull myregistry.com/xxx/nginx:1.23.2, so the image has been downloaded locally, then execute nerdctl build -t test-nginx:v1 . again, it is successful.
What version of nerdctl are you using?
$ nerdctl version
client:
version: v2.2.1
os: linux/arm64
buildctl:
version: v0.26.3
server:
containerd:
version: v2.2.1
runc:
version: 1.0.0-rc3
Are you using a variant of nerdctl? (e.g., Rancher Desktop)
Others
Host information
kerner version is 4.19.90-89.23.v2401.ky10.aarch64
- Dominant language
- Go
- Stars
- 10.5k
- Forks
- 853
- Avg merge
- 6d 14h
- Merged PRs (30d)
- 38
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from containerd/nerdctl
-
Test and examples: update wordpress images (to silence potential false security alerts)Possibly taken @Guurdeep claimed this 20 days ago. Openarea/ci documentation priority/low
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
containerd/nerdctl#5283 · 2 comments ·
Maintainers usually reply within 3 days
-
`nerdctl kill` shouldn't set `containerd.io/restart.explicitly-stopped` label for non-stop signalsMay be free again A pull request for this issue was closed without being merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
containerd/nerdctl#5171 · 3 comments ·
Maintainers usually reply within 3 days
-
area/project
Difficulty 1/5 Under an hour Newbie friendliness 25/100
containerd/nerdctl#5383 · 5 comments ·
Maintainers usually reply within 3 days
-
Restart-policy containers loop on "unable to apply apparmor profile" after reboot until the creating user logs in (OCI hook inherits the client's XDG_RUNTIME_DIR)Possibly taken @Shubhranshu153 claimed this today. Openarea/rootless bug
Difficulty 3/5 1-2 days Newbie friendliness 72/100
containerd/nerdctl#5377 · 1 assignee ·
Maintainers usually reply within 3 days
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
containerd/nerdctl#5355 ·
Maintainers usually reply within 3 days
All issues in containerd/nerdctl
Similar issues
-
P3 tech debt
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
kind/feature needs-triage priority/unprioritized
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NVIDIA/k8s-test-infra#1504 ·
Maintainers usually reply within 1 day
-
Area/Infrastructure Aspect/Infra Resources Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
wso2/agent-manager#2717 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
open-policy-agent/opa#9685 · 1 comment ·
Maintainers usually reply within 1 day