while ! nc -z httpd 80; do sleep 0.1; done
while [[ ! -n "$(docker images -q httpd)" ]]; do echo "Image is not available..."; sleep 0.1; done
source: https://unix.stackexchange.com/questions/343942/shell-check-if-docker-container-is-existing
while [[ ! -n `docker ps --filter="name=httpd" -q` ]]; do echo "Waiting for docker container to start..."; sleep 0.1; done