What I'm currently doing:
Dockerfile:
FROM python:3.5.1 ENV PYTHONUNBUFFERED 1 RUN mkdir /www WORKDIR /www ADD deps.txt /www/ RUN pip3 install -r deps.txt ADD . /www/ RUN chmod 0755 /www/docker-init.sh
Build command:
docker build -t my-djnago-app:latest .
Tagging:
docker tag my-djnago-app:latest lolorama/my-djnago-app-img:latest
Pushing:
docker push lolorama/my-djnago-app-img:latest
After following these steps, the repository image still hasn't updated. I keep getting this message - "Layer already exists".
The push refers to a repository [docker.io/lolorama/my-django-app-img] fd5aa641b308: Layer already exists d9c60c6f98e8: Layer already exists d9d14867f6d7: Layer already exists 64ce166099ca: Layer already exists 73b670e35c69: Layer already exists 5f70bf18a086: Layer already exists 9ea142d097a5: Layer already exists 52f5845b1de0: Layer already exists e7fadb3ab9d4: Layer already exists cef72744de05: Layer already exists 591569fa6c34: Layer already exists 998608e2fcd4: Layer already exists c12ecfd4861d: Layer already exists
What am I doing wrong?
To push an image to Docker Hub, you must first name your local image using your Docker Hub username and the repository name that you created through Docker Hub on the web. You can add multiple images to a repository by adding a specific :<tag> to them (for example docs/base:testing ).
You can rebuild the image from the base image without using cached layers by using the --no-cache option. New layers were constructed and used. The docker build runs both commands this time, which comes with an all-or-nothing approach.
By pushing a new Docker image to your repository, Watchtower will automatically trigger a chain of events to update your running container's base Docker image. When Watchtower detects a new push, it will pull the new base image, gracefully shutdown your running container, and start it back up.
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'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With