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?

  • How to build docker image from github repository
  • Friendly URL between docker containers/images
  • Local Java App not running on HBase/Phoenix Docker image
  • Linking container with docker-compose
  • What special precautions must I make for docker apps running as pid 1?
  • How can I overwrite a file through Dockerfile in docker container?
  • Installing pure-ftpd in docker (Debian wheezy), error 421
  • docker-machine, docker-compose and google cloud
  • docker-compose on windows directory sync
  • Remote debugging NodeJS in Docker with Visual Studio Code
  • my own customizations of boot2docker are not reflected into the iso image
  • Local pypi server tells me 403 Forbidden when registering packages
  • 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
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.