How to push a docker image to Docker Hub on Fedora 26?

388 views Asked by At

Following sequence doesn't work:

# docker login
# docker tag <image-hash> <docker-hub-id>/<name>
# docker push <docker-hub-id>/<name>

fails with

The push refers to a repository [registry.fedoraproject.org/<docker-hub-id>/<name>]
9c360ae72584: Preparing 
55b267618723: Preparing 
unauthorized: authentication required

It looks like docker tries to push the image to the wrong repository.

1

There are 1 answers

0
czerny On

Fedora doesn't use Docker Hub as default repository by default. One has to explicitly state the target repo:

# docker login docker.io
# docker tag <image-hash> docker.io/<docker-hub-user-id>/<name>
# docker push docker.io/<docker-hub-user-id>/<name>