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
Run:
docker version
If docker is running you will see:
Client: Docker Engine - Community
Version: ...
[omitted]
Server: Docker Engine - Community
Engine:
Version: ...
[omitted]
If docker is not running you will see:
Client: Docker Engine - Community
Version: ...
[omitted]
Error response from daemon: Bad response from Docker engine