docker push to the registry with changed Dockerfile and same tag

Patrik Mihalčin picture Patrik Mihalčin · Nov 14, 2016 · Viewed 11.8k times · Source

Imagine, I have docker image based on Dockerfile, I will tag & push it into docker registry

Over time, I change Dockerfile (add/change new instructions, ...)

Now, I will tag new image again with the same tag I used in the first place and push it into docker registry

  1. How does docker registry react to new layers?
  2. How does docker registry react to changed layers?
  3. Will it overwrite existing image with the latest version?
  4. Should I use different tag to make sure I have correct new image in place?

Answer

CashIsClay picture CashIsClay · Nov 14, 2016

How does docker registry react to new layers? How does docker registry react to changed layers?

It will function the same as a pull -- unchanged layers will not be pushed again and new layers will be pushed.

Will it overwrite existing image with the latest version?

Yep.

Should I use different tag to make sure I have correct new image in place?

Usually. Using latest to represent the most recent is fine but you should add a second tag for the actual version so that dependent systems can pin to that version and upgrade as needed.