Search code examples
docker

What is the created time in docker images command?


What is the CREATED time exactly when you give this command?

docker images enter image description here

It gives the time like "3 months ago", or "9 days ago".

Is it the time it was uploaded to docker hub?

Even for the locally created images, it shows like "15 minutes ago", while I had created it just a minute ago.


Solution

  • It should be the date of the latest docker build run by the image owner, as defined in the image/image.go file, which can be found in the container once the image has been run.

    You can inspect low-level image info to see its exact value with:

    docker inspect -f '{{.Created}}' hello-world
    

    where 'hello-world' is the name of your image.

    If you are in a VM, the timestamp might not be precise for local images, as your VM clock might not be precisely synchronized (by typing 'date', I see mine is synchronized, but on UTC: one hour shift).