when you use http and 80,iIt has become extremely confusing

Open
#4,730 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
go
Domain
cli

Research direction

Reproduce the behavior with nerdctl login and nerdctl pull against the HTTP registry, then compare /etc/containerd/certs.d/hosts.toml with the matching entry in ~/.docker/config.json. Trace how the CLI handles the explicit :80 endpoint, authentication lookup, and --insecure-registry; done means the intended port-80 HTTP configuration is consistent between login and pull without unexpected HTTPS behavior.

Written by the indexing model from the issue text.

Description

kind/feature
What is the problem you're trying to solve

When I run the login command:nerdctl login harbor.my.com:80 --username admin --insecure-registry

I have to specify port 80 and the --insecure-registry flag.

Manually prepending http://harbor.my.com:80 also doesn’t work—it still redirects to HTTPS, and I have to include the --insecure-registry flag regardless.

The problem, however, lies with the hosts.toml file under /etc/containerd/certs.d:

# You still need to specify port 80
# Because port 80 is included in your login command
[host."http://harbor.my.top:80"]
  capabilities = ["pull","push","resolve"]
  #skip_verify = true
  #ca=""

# If port 80 is included in your login command
# Your ~/.docker/config.json will have the following content
# So you must specify port 80 in hosts.toml when running nerdctl pull 
# (nerdctl retrieves authentication credentials from ~/.docker/config.json)
"auths": {
        "harbor.deep-space.top:80": {
                "auth": "xxxxxxx="
        }
}

This situation is extremely frustrating. I understand the issue stems partly from containerd and partly from nerdctl.
With Docker, by contrast, I only need to specify the insecure registry in daemon.json and that’s it.

I spent the entire night debugging my private registry mirror accelerator. I kept thinking the issue was with Harbor, but it worked perfectly fine when I switched to Docker—until I finally figured out the problem with port 80.

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from containerd/nerdctl

All issues in containerd/nerdctl

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.