When you build a Docker image without specifying a tag (e.g., docker build .
), Docker automatically tags it with latest
. This happens at the time of the build.
The latest
tag is not a dynamic pointer. If you build another image afterward (without a tag), the latest
tag will move to this new image. However, if you've already pulled an image tagged latest
, you won't automatically get the newest one unless you explicitly pull it again. If someone manually tags an older image with latest
it will overwrite the previous latest
tag.
> You can tag any image as latest, even an old version of the same image.
> The best practice is to tag images with something more meaningful than relying on just latest tag (v.1.1.1).
****
A) latest
is not dynamic in the way described. It doesn't magically update on your local machine.
C) latest
does not lock to a build timestamp. It simply points to the most recently built image at the time of the build.
D) latest
is used by default if you don't specify a tag during the build. If you don't specify a tag during the pull, Docker assumes you intend to pull the latest
tag.