Score:2

How do you login to docker hub when using containerd?

it flag

With docker I would run docker login, but how do you do similar with ctr/containerd?

We need to login due to hitting rate limits:

ctr: failed to copy: httpReaderSeeker: failed open: unexpected status code https://registry-1.docker.io/v2/library/[...]: 429 Too Many Requests - Server message: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit

Following the containerd docs with /etc/containerd/config.toml:

version = 2
[plugins."io.containerd.grpc.v1.cri".registry.configs."docker.io".auth]
  username = "myusername"
  password = "mypassword"

doesn't seem to work.

Jethro avatar
it flag
Also the version from https://github.com/containerd/cri/issues/835#issuecomment-403652902 but with `docker.io` instead also fails.
Score:2
in flag

Yeah, me too and I don't understand why. So, I edited my config like as guide: https://docs.d2iq.com/dkp/kommander/1.4/operations/manage-docker-hub-rate-limits/

Like as you can see, original code in document

[plugins."io.containerd.grpc.v1.cri".registry.configs."docker.io".auth]

If change to this (full domain), it works

[plugins."io.containerd.grpc.v1.cri".registry.configs."registry-1.docker.io".auth]

Restart containerd and check.

Testing, write bash script

TOKEN=$(curl --user 'YOUR_LOGIN_USER:YOUR_LOGIN_PASSWORD' "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest | grep -i rate

My result, avaiable 198/200

ratelimit-limit: 200;w=21600
ratelimit-remaining: 198;w=21600
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.