Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get exact date for docker images?

Tags:

docker

I run docker images and get something like this:

REPOSITORY                       TAG                 IMAGE ID            CREATED             VIRTUAL SIZE docker.io/postgres               latest              a7d662bede59        2 weeks ago         265.3 MB docker.io/ubuntu                 latest              91e54dfb1179        2 weeks ago         188.3 MB 

Look at CREATED column. I want to know what image created earlier with hours, minutes, seconds. Similar with containers, for command docker ps -a. How to view exact dates?

like image 677
Alex T Avatar asked Sep 21 '15 21:09

Alex T


People also ask

How can I tell when a docker image was created?

I think the best way would be to run docker inspect IMAGE_OR_CONTAINER , then pipe the output to grep to filter the results to what you really want. ... which results in the following output: "Created": "2015-09-18T01:46:51.471641483Z", That's pretty clean.

How do I keep my docker images up to date?

When a new version comes out, update the tag in your docker-compose. yml , docker-compose pull , and then restart the container ( docker-compose down && docker-compose up -d ). This is simple, and robust, and means nothing will update without you knowing.

How do I find my docker image ID?

The easiest way to list Docker images is to use the “docker images” with no arguments. When using this command, you will be presented with the complete list of Docker images on your system. Alternatively, you can use the “docker image” command with the “ls” argument.


1 Answers

Use docker inspect:

docker inspect -f '{{ .Created }}' IMAGE_OR_CONTAINER 

From: Exact times in "docker ps" and "docker images"

like image 192
wbrugato Avatar answered Sep 22 '22 06:09

wbrugato