Building a new docker image with the same name as an existing ones
If I build a new docker image with the same name as an existing ones, will the old ones be overwritten?
2 Solutions collect form web for “Building a new docker image with the same name as an existing ones”
Images in Docker don’t have a name, they have tags.
A tag is a reference to an image. Multiple tags may refer to the same image.
If you reassign a tag that is already used, then the original image will lose the tag, but will continue to exist (it will still be accessible by its image ID, and other tags might refer to it).
You can use versions with your tags e/g/:
docker build -t <USER>/<CONTAINER>:<VERSION> docker build -t maluuba/haproxy:2 docker build -t maluuba/haproxy:latest #Default behavior when you don't use version docker build -t maluuba/haproxy:old