Reputation: 83
I am trying to push to docker but it says it says that authorisation is needed. I know to solve this problem i am meant to add my user name before the docker push. I have built a docker image using :
docker build -t registry.heroku.com/myapp/web .
This build an image in my docker hub. I ensure that i am logged into my docker and also ensure that i have a heroku container built and logged in.
heroku login
heroku container: login
Then when i try to do a docker push:
docker push myname/registry.heroku.com/myapp/web
i then get an error saying: An image does not exist locally with the tag: myname/registry.heroku.com/myapp/web
When I do docker images
then it comes up with the image i created registry.heroku.com/myapp/web
Does anyone know what i am doing wrong?
Upvotes: 0
Views: 1319
Reputation: 109
You have built registry.heroku.com/myapp/web image and trying to push myname/registry.heroku.com/myapp/web which definitely doesn't exist.
You need to push the image with the same name that you have built.
Heroku does not accept images with myname/registry.heroku.com/myapp/web. It should be registry.heroku.com/myapp/web
So try pushing the image (It is correct)
docker push registry.heroku.com/myapp/web
myname/registry.heroku.com/myapp/web (It is Incorrect)
heroku container:login
docker login --username=_ --password=$(heroku auth:token) registry.heroku.com
docker push registry.heroku.com/myapp/web
Follow This Heroku Document on pushing images
Upvotes: 1