Let’s start with the command run
. When rotating docker run ubuntu
Docker will check if there is a Ubuntu image locally using the tag :latest
. If there is a Docker it will create a container using this image, if not it will perform the docker pull ubuntu:latest
and, after that, create the container.
When rotating the command docker pull ubuntu
he will check if there is an image of Ubuntu with the tag :latest
, if not, it will download the image. If docker pull
he finds a local image with the tag :latest
then you will download the image signature (a hash in sha256) that is there in Dockerhub and compare it to the signature of your local image, if they are equal it prints on the console something like:
status: Image is up to date for ubuntu:latest
If they are different it will download the new image and mark the old one with the tag <none>
, getting something like this:
Repository tag Image ID CREATED SIZE
ubuntu latest 113a43faa138 2 weeks ago 81.2MB
ubuntu <none> 452a96d81c30 7 weeks ago 79.6MB
Uhmmm. Show! Then the new project will use the latest version. If I raise the old project, will it also run based on the last one? Does <None> get parked type, useless? I know it would be another question. But thanks!
– Fabiano Monteiro
when an image gets this tag
<none>
It does no good, it only takes up disk space because Docker does not use it to generate a new container. If you update an image Docker will always use the newest (the local image with the specified tag) to create new containers.– Lucas Duete