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
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.
Currently, if you deploy an image with a user, then try to push the image again (to overwrite it) with no delete/overwrite permissions, the docker client returns a successful message. If you try to overwrite the image/tag with a different image, then there will be an error.
A tag must point to a single Docker image but a single Docker image can have many Tags. So let's rebuild the previous image with version:latest tag. In the above case, we built a new image (without modifying the contents) with the name version:latest though we left out :latest part so that Docker can do its magic.
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.
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