I was getting the same error, which OP is referring to, googling the exact phrase brought me here, but, in my case, I was pushing it to the default/public repository (hub.docker.com) instead of the local one. But as it turns out the issue was the same
This was my local image which I created on my disk
[root@ip-172-31-22-195 centos]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos latest 927311af2297 20 hours ago 193MB
I tagged it like this:
docker tag centos devopskalsym:latest
then confirmed the tag being created:
[root@ip-172-31-22-195 centos]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
devopskalsym latest 927311af2297 20 hours ago 193MB
centos latest 927311af2297 20 hours ago 193MB
Since my repository on docker hub was: devopskalsym/centos7, I tried to push it:
docker push devopskalsym/centos7:latest
and got the error:
[root@ip-172-31-22-195 centos]# docker push devopskalsym/centos7:latest
The push refers to repository [docker.io/devopskalsym/centos7]
An image does not exist locally with the tag: devopskalsym/centos7
so I removed the tag with:
[root@ip-172-31-22-195 centos]# docker rmi devopskalsym
Untagged: devopskalsym:latest
then re-tagged correctly with the format mentioned by @BMitch.
docker tag centos:latest devopskalsym/centos7:latest
the format used is this: docker tag local-image:tagname new-repo:tagname
now it correctly shows the images:
[root@ip-172-31-22-195 centos]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
devopskalsym/centos7 latest 927311af2297 20 hours ago 193MB
centos latest 927311af2297 20 hours ago 193MB
then pushed it again:
docker push devopskalsym/centos7:latest
and it worked
[root@ip-172-31-22-195 centos]# docker push devopskalsym/centos7:latest
The push refers to repository [docker.io/devopskalsym/centos7]
b7d51bf3d09e: Pushing [==================================> ] 132MB/193.3MB
Note: you might need to login with docker login
docker push
should really return a a clearer error message, likepush of image with tag X failed because no image with tag X was found
. – Housefly