Docker - What is the right way to rebuild and direct the updated image to the docker cloud?

What am I doing now:

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 

Press:

 docker push lolorama/my-djnago-app-img:latest 

After completing these steps, the storage image is still not updated. I keep getting this message - "The 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?

+23
docker dockerfile docker-cloud docker-image
source share
2 answers

I found the problem, thanks @ lorenzvth7!

I had two images with the same tag (which I was pushing into the cloud).

Decision:

  • Inspect your images and find two or more with the same tag:

     docker images 
  • Delete them:

     docker rmi --force 'image id' 
  • Here it is! Follow the steps from my question above.
+20
source share

Another solution, albeit bruteforce, is to recompile with the --no-cache flag before clicking again.

 docker rmi --force my-djnago-app:latest docker build -t my-djnago-app:latest . --no-cache docker push my-djnago-app:latest 
+1
source share

All Articles