28

When pushing a docker image to registry, I got this message:

docker push -t domain.com/repo/tag_docker_name:latest

Error tag name does not exist

The only way is to create the tag in docker repository via web interface, and then docker push works.

Is there a command line to create docker push?

Josh Correia
  • 3,807
  • 3
  • 33
  • 50
tensor
  • 3,088
  • 8
  • 37
  • 71
  • Possible duplicate of [denied: requested access to the resource is denied : docker](https://stackoverflow.com/questions/41984399/denied-requested-access-to-the-resource-is-denied-docker) – kenorb May 20 '18 at 20:04
  • Don't use -t. Try without -t. Also, try providing a port number after domain.com – user674669 Mar 15 '19 at 20:42
  • How do you create the tag in docker repository via web interface? – Rafael Jul 07 '20 at 03:29

5 Answers5

38

You need to add a tag to the image, here is the documentation. Use it like this docker tag 0e5574283393 domain.com/repo/tag_docker_name:latest where 0e5574283393 is the image hash

David
  • 1,636
  • 19
  • 27
  • 13
    Tag is already added to the image. Problem is docker registry server which does not recognize this tag.... – tensor Apr 15 '18 at 09:13
  • I misspelled the tag, so when I tried to push with the correct tag name, it couldn't find it (because it didn't exist locally). Make sure your local tag spelling matches the tag you're trying to push. – TetraDev Oct 29 '19 at 16:34
8

If you have not tagged your image while docker build and added tag on push, you will get this error.

In my case, I haven't tagged the image and while build but push command added tag, that is why I was getting this error. below is my correct command

docker image build -t pankajrawat333/samplewebapp:v1 .
docker image push pankajrawat333/samplewebapp:v1
Pankaj Rawat
  • 4,037
  • 6
  • 41
  • 73
5

First there is no option -t for docker push command

Second assume that you already have a tagged image said repo/your_image:tag, you should follow the push syntax docker push repo/your_image:tag, docker host should not be included (in your case domain.com) unless you want to push the image to a private repository.

A simple way to check whether the image name existed is to use docker images, which lists all images available on the host, and image name should be the same as displayed in REPOSITORY column.

Follow this link to check docker documentation

Oda Mitsuru
  • 704
  • 1
  • 6
  • 5
3

The official usage is below:

docker push < IMAGENAME >:< TAGNAME >
seylul
  • 61
  • 7
2

sudo docker tag (imagename or hash)(dockerhubaccountname or id)/(repositoryname):(give the tag name like v1)

eg - sudo docker tag myimage5 hitanshug/testrep:v1

then run this command docker push hitanshug/testrep:v1 , always remember the tag v1 to mention it in both commands.

And if you want to push in a private repo, then first do Docker login, give the credentials, and run all the above commands.

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 07 '23 at 14:43