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

前端 未结 17 1324
既然无缘
既然无缘 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条回答
  •  猫巷女王i
    2021-01-30 05:33

    You can check with this command systemctl status docker it will show the status of the docker. If you want to start you can use systemctl start docker instead of systemctl you can try also with service, service docker status and service docker start respectively.

提交回复
热议问题