Home  >  Q&A  >  body text

docker - 获取一个容器的退出时间

请问如何获取一个容器的退出时间?

docker 1.10版本增加了这个参数: docker ps -a --format "{{.CreatedAt}}" ,我现在能获取准确的创建时间。

大家讲道理大家讲道理2708 days ago734

reply all(2)I'll reply

  • 某草草

    某草草2017-04-24 16:01:26

    docker inspect --format='{{.State.FinishedAt}}' 439e89c0b9e8

    439e89c0b9e8 is the container ID

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-04-24 16:01:26

    The method above is not feasible, the docker container has exited, and that IP is no longer available,

    docker inspect --format='{{.State.FinishedAt}}' e9f0fcaf20e4
    
    Error: No such image or container: e9f0fcaf20e4

    reply
    0
  • Cancelreply