Jikku Jose
Jikku Jose

Reputation: 18804

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

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?

Upvotes: 6

Views: 596

Answers (2)

Harmeet Singh
Harmeet Singh

Reputation: 2616

Me also facing same issue, what I have come to is

https://github.com/docker/docker/issues/18866#issuecomment-192770785 https://github.com/docker/docker/issues/14018

As mentioned in above links this feature is implemented in Docker Engine 1.10 / Registry 2.3.

And after email to docker support I got the following reply

Hello,

Unfortunately, we don't have any timelines for when updates to the Docker Hub will happen that we can share publicly. Sorry for any trouble caused by this.

/Jeff

Upvotes: 0

askb
askb

Reputation: 6786

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.

Upvotes: 1

Related Questions