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
You can also check if a particular docker container is running or not using following command:
docker inspect postgres | grep "Running"
This command will check if for example my postgres container is running or not and will return output as "Running": true
Hope this helps.