script to check if docker container is running code example Example 1: check if docker is running systemctl status docker Example 2: docker check running containers docker ps -a