"tag latest not found" on docker pull with private registry

13.5k views Asked by At

I'm having troubles pulling images pushed to a private registry and get:

Tag latest not found in repository

I'm using the default registry container provided by Docker:

# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
registry            latest              7e2db37c6564        8 days ago          411.6 MB
janos/wheezy        latest              900e813f1fd9        11 months ago       218.6 MB

As a test, let's say I want to have a local version of wheezy:

# docker tag janos/wheezy staging-docker.mysite.nl/myself/wheezy
# docker push staging-docker.mysite.nl/myself/wheezy
The push refers to a repository [staging-docker.mysite.nl/myself/wheezy] (len: 1)
Sending image list
Pushing repository staging-docker.mysite.nl/myself/wheezy (1 tags)
7af801e4faa1: Pushing [==================================================>] 226.3 MB/226.3 MB
2014/11/21 16:06:38

The image seems to be there:

# docker images
REPOSITORY                             TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
registry                               latest              7e2db37c6564        8 days ago          411.6 MB
staging-docker.mysite.nl/myself/wheezy   latest              900e813f1fd9        11 months ago       218.6 MB
janos/wheezy                           latest              900e813f1fd9        11 months ago       218.6 MB

And locally I can start it:

# docker run -i -t staging-docker.mysite.nl/myself/wheezy /bin/bash
root@6b5fafe61d88:/# ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  selinux  srv  sys  tmp  usr  var
root@6b5fafe61d88:/# exit

But when trying to run or pull it from another server, I get "Tag latest not found"

# docker pull staging-docker.mysite.nl/myself/wheezy
Pulling repository staging-docker.mysite.nl/myself/wheezy
2014/11/21 16:08:15 Tag latest not found in repository staging-docker.mysite.nl/myself/wheezy

Explicitly adding "latest" does not help. Same error.

I can see the calls arrive at the registry, so I'm not inadvertedly using another:

172.17.42.1 - - [21/Nov/2014:15:08:15 +0000] "GET /v1/_ping HTTP/1.0" 200 1439 "-" "Go 1.1 package http"
172.17.42.1 - - [21/Nov/2014:15:08:15 +0000] "GET /v1/_ping HTTP/1.0" 200 1439 "-" "Go 1.1 package http"
21/Nov/2014:15:08:15 +0000 DEBUG: args = {'namespace': u'myself', 'repository': u'wheezy'}
172.17.42.1 - - [21/Nov/2014:15:08:15 +0000] "GET /v1/repositories/myself/wheezy/images HTTP/1.0" 200 164 "-" "docker/1.3.1 go/go1.3.3 git-commit/4e9bbfa kernel/3.16.0-0.bpo.2-amd64 os/linux arch/amd64"
21/Nov/2014:15:08:15 +0000 DEBUG: args = {'namespace': u'myself', 'repository': u'wheezy'}
21/Nov/2014:15:08:15 +0000 DEBUG: [get_tags] namespace=myself; repository=wheezy
172.17.42.1 - - [21/Nov/2014:15:08:15 +0000] "GET /v1/repositories/myself/wheezy/tags HTTP/1.0" 200 2 "-" "docker/1.3.1 go/go1.3.3 git-commit/4e9bbfa kernel/3.16.0-0.bpo.2-amd64 os/linux arch/amd64"

And when checking the tags of the image manually, they are indeed empty:

# curl -k https://staging-docker.mysite.nl/v1/repositories/myself/wheezy/tags
{}

Question 1: how come it is empty in the first place, since Docker always uses latest...

Question 2: if somehow things got messed up and the latest tag is indeed gone, how come I can still start it up locally?

Docker versions are the same on both servers:

# docker version 
Client version: 1.3.1
Client API version: 1.15
Go version (client): go1.3.3
Git commit (client): 4e9bbfa
OS/Arch (client): linux/amd64
Server version: 1.3.1
Server API version: 1.15
Go version (server): go1.3.3
Git commit (server): 4e9bbfa
2

There are 2 answers

0
Larry Cai On

Questions 1:

It shall be the problem in your remote private registry, this is confirmed with your command

curl -k https://staging-docker.mysite.nl/v1/repositories/myself/wheezy/tags

Question 2

tag is just the alias for the docker image, if you run locally in different naming, they are all run from the same docker images, no difference.

And the tag latest doesn't lost locally, which is confirmed by your command

$ docker images

Solution

Check your docker private registry setup and trace the log to see what's the problem, if you want to solve it completely, you need to attach more debug information in remote private registry.

Also how the remote registry setup is like version and platform.

0
Slack Flag On

I have noticed that Docker client failure messages don't always reflect the root cause. I've seen this condition happen when the docker client has not authenticated with the server, or also when the SSL handshake fails for some reason. Given that you were not using --insecure-registry, it sounds like the latter.