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?

  • jaas basic authentication jetty-runner
  • How to use stack image container?
  • Recommended way to mimic a production server with Docker
  • Refer to another service/task running in same ECS cluster
  • Docker container cannot connect to linked containers services
  • `const_get': uninitialized constant [class] (NameError)` after file save in Docker with Spring
  • Import images from kitematic to boot2docker
  • Running a script inside a docker container using shell script
  • Put haproxy outside docker compose
  • Keep docker-compose container running after ENTRYPOINT
  • NGINX & Consul-Template in Docker
  • Debug django app running inside docker image, using pycharm debugger
  • 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.