check whether docker is running bash code example
Example 1: how check status docker in ubuntu
sudo systemctl status docker
#(OR)
systemctl status docker.service
# To check the status of Docker whether running or not.
Example 2: how to check ip of docker container
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id
Example 3: how to check if i have docker installed
$ docker -v
Docker version 1.7.0, build 0baf609
$ echo $?
0