3

I have Docker ID, let's say -> KN, and created a private repo. I can log into Docker Hub via CLI too. I run a container based on a image & commit that container to an image with following command

docker commit ub18 reponame/ub18 ==> successfull

but when I push that image like following, it doesn't upload.

Output of Docker images shows this image on top.

docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
standard/ub18       latest              c8ebc0f1dd75        12 seconds ago      102MB


docker push reponame/ub18  ==> gives error
The push refers to repository [docker.io/standard/ub18]
7660ded5319c: Preparing 
94e5c4ea5da6: Preparing 
5d74a98c48bc: Preparing 
604cbde1a4c8: Preparing 
denied: requested access to the resource is denied
6
  • add the error information Commented May 3, 2019 at 7:18
  • You need to login fist with "docker login"
    – Mihai
    Commented May 3, 2019 at 7:26
  • @Akshaybarahate ok I updated Qs
    – Sollosa
    Commented May 3, 2019 at 7:26
  • @Mihai I think I mentioned that I can successfully login
    – Sollosa
    Commented May 3, 2019 at 7:27
  • 1
    is reponame your dockerhub id? Commented May 3, 2019 at 7:31

1 Answer 1

7

So to push your images to your Docker Hub repo first you have to login to Docker Hub repo using username and password:

docker login

Then perform tagging of your image properly :

docker tag image_id yourhubusername/reponame:tag

Your image tag has to be in this specific format. Then to push :

docker push yourhubusername/reponame:tag

assuming you are logged in.

If you want to gain more information about it, refer to docker docs.

2
  • 1
    Note that you have to log in with docker login even if you want to push to a public repo. This is not mentioned in the docs as far as I can tell. Commented Feb 17, 2022 at 11:27
  • If the login does not work, run the following commands: sudo service docker stop && rm ~/.docker/config.json && sudo service docker start then run docker login again.
    – Loich
    Commented Jun 6, 2023 at 22:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.