Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
153 views
in Technique[技术] by (71.8m points)

How can i see the last date that a volume was used by docker container

So i restarted elk because it crushed but then my app crushed(all the containers) so i removed kibana, elastic and logstash and started the other ones again. I have couple of old volumes that i did not deleted and i don't remember what was the name of the volume that i use in elk and i have couple of versions of elk compose file with the different volumes so i dont know wich one was the latest one with all the data of the app. So my idea is to see the date of the last modification of the volume so i can detect which one is the last volume that i used.

using:

docker inspect nameOfContainer

i can see "CreatedAt": "2020-03-04T16:31:54+01:00" but is there any way too see the latest modification date of the volume and not the creation date?

Thank you.

question from:https://stackoverflow.com/questions/65934112/how-can-i-see-the-last-date-that-a-volume-was-used-by-docker-container

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

No. You can use docker volume inspect <volume_name> to inspect the configuration of the volume.

If you run this command the fields that you will see are below, you only can see CreatedAt not the modification time.

"CreatedAt":
"Driver": 
"Labels":
"Mountpoint": 
"Name": 
"Options": 
"Scope": 

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...