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?

  • ERROR: Build process returned exit code 137 during Docker build on Tutum
  • How can I build a coturn server with dockerfile configuration?
  • Cannot push images to Dockerhub
  • Is there an Official Android development environment image on Docker?
  • Docker Compose to CoreOS
  • docker run local script without host volumes
  • Is it acceptable to create tests relying on docker for a node.js module?
  • “Error response from daemon: Cannot start container … no such file or directory” on Oracle Linux running hello-world
  • Mac OS X sudo docker Cannot connect to the Docker daemon. Is the docker daemon running on this host?
  • How to launch AVD while keep running docker
  • How do I wait for a pull?
  • Use gRPC to communicate between containers
  • 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.