Docker - What is proper way to rebuild and push updated image to docker cloud?
I found the problem, thanks to @lorenzvth7!
I've had two images with same tag (which i was pushing to cloud).
Solution is:
Inspect your images and find two or more with the same tag:
docker images
Delete them:
docker rmi --force 'image id'
- Thats it! Follow steps from my question above.
Another solution, albeit bruteforce, is to rebuild with the --no-cache flag before pushing again.
docker rmi --force my-djnago-app:latestdocker build -t my-djnago-app:latest . --no-cachedocker push my-djnago-app:latest
I meet the problem as well(In my web application
), like this:
# when I push my contaimer to repo$ docker push <container>The push refers to repository [docker.io/xx/getting-started]fd5aa641b308: Layer already existsd9c60c6f98e8: Layer already existsd9d14867f6d7: Layer already exists64ce166099ca: Layer already exists73b670e35c69: Layer already exists5f70bf18a086: Layer already exists9ea142d097a5: Layer already exists52f5845b1de0: Layer already exists
I try my Solution, and it's works!
# force remove image$ docker rmi --force <image-id># tag for image$ docker tag <image-name> <your-dockerHub-username>/<image-name># push image, just done!$ docker push <your-user-name>/<image-name>
terminal output:
# when I push my container to repo$ docker push <container>The push refers to repository [docker.io/xx/getting-started]# it'll push your part of changesfd5aa641b308: Pushedd9c60c6f98e8: Pushedd9d14867f6d7: Layer already exists64ce166099ca: Layer already exists73b670e35c69: Layer already exists5f70bf18a086: Layer already exists9ea142d097a5: Layer already exists52f5845b1de0: Layer already exists
Then, open my web appliction
, it's updates the lastest version!