Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does a Docker Hub require to upload the entire image every time I make a change?

Tags:

docker

I was trying out Docker and I did the following:

  1. Pulled an image called: docker/whalesay
  2. Built another image with some minor changes.
  3. Pushed it back in a different name to my public repository (Had to upload approximately the same size I downloaded).
  4. I then built another image with this public image as the starting point.
  5. Had only a single command. But again I had to upload the entire image back.

My question is, isn't Docker supposed to upload just the changes? I read it somewhere. It seems like I am making some stupid mistake, I can't believe that we have to upload the entire image everytime after minor changes. Am I missing something?

This is the Dockerfile I am using to build the image fishsay:

FROM docker/whalesay:latest
RUN apt-get -y update && apt-get install -y fortunes
CMD /usr/games/fortune -a | cowsay

The whalesay image was ~180 MB; so when I push shouldn't I have to just upload the changed layers?

like image 880
Jikku Jose Avatar asked Oct 11 '15 12:10

Jikku Jose


People also ask

Does Docker always pull the latest image?

By default, Docker pulls the latest version. To ensure it does so, you can add the :latest tag.

How are images in Docker Hub created and maintained?

Creating and maintaining images for Docker Official Images is a collaborative process. It takes place openly on GitHub where participation is encouraged. Anyone can provide feedback, contribute code, suggest process changes, or even propose a new Official Image.

Does Docker compose build image every time?

Description. Services are built once and then tagged, by default as project_service . If the Compose file specifies an image name, the image is tagged with that name, substituting any variables beforehand.


1 Answers

Any changes to a layer in your image would requires to be updated in the repository when you call the docker push. This could be a small and trivial such as including a new package (ex: vi) in your image. However, this would cause new layers to be created and replace the existing layers, causing different layer id's, from what is already in the registry. docker push uploads all new layers created into the registry, excluding the base image.

like image 132
askb Avatar answered Oct 09 '22 20:10

askb