How to check if the docker engine and a docker container are running?

前端 未结 17 1640
既然无缘
既然无缘 2021-01-30 05:03

In a script, I need to check:

a) Is the docker engine running?
b) Given a container name, is that docker container running?

[the initial wording of this

17条回答
  •  不知归路
    2021-01-30 05:26

    container status: true/false

    # docker inspect --format '{{json .State.Running}}' container-name
    true
    #
    

提交回复
热议问题