How to check if docker daemon is running?

后端 未结 7 787
庸人自扰
庸人自扰 2020-12-15 04:31

I am trying to create a bash utility script to check if a docker daemon is running in my server. Is there a better way of checking if the docker daemon is running in my serv

7条回答
  •  心在旅途
    2020-12-15 04:33

    I'm sure you want to start the docker daemon so here's the code to start it before executing your Docker run statement:

    sudo systemctl start docker
    

提交回复
热议问题