16

I create a automated build repository on dockerhub (via github) and try to pull the image which is automatically built onto cloud server.

using things like

docker pull com.company/project:tag

but it gives me

Error: image com.company/project:tag not found

it usually works for public repository, do I have to do something else for private repository ?

Arturas Smorgun
  • 954
  • 1
  • 8
  • 22
Hello lad
  • 17,344
  • 46
  • 127
  • 200

2 Answers2

35

You just need to use the command docker login with your sign parameters from docker hub.

Anderson Santos
  • 466
  • 5
  • 6
12

Another way to do this is to create a docker config.json file. The file should be placed in ~/.docker/config.json and the Docker Hub authorization token can be specified in the file.

{
    "auths": {
        "https://index.docker.io/v1/": {
            "auth": "my-docker-hub-generated-auth-token"
        }
    }
}

This is a useful strategy if you are working with servers that need the ability to run scripts that pull images from Docker Hub.

Resources and further infomration:

Gunther
  • 2,474
  • 4
  • 31
  • 45
  • The current implementation is `base64("username:token")`. Using `docker login registry.url.here -uusername -p` should generate the correct data. – ssi-anik Jan 06 '22 at 13:04