docker run -d ubuntu:14.04 /bin/bash -c "while true; do echo hello world;done"
docker run -d ubuntu:14.04 /bin/bash "while true; do echo hello world; done"
I tried both.
In case 2, the container stopped immediately. So docker ps
returns nothing. And docker ps -a
returns just itself.
In case 1, docker ps
lists the container. It is not stopped.
So what does -c flag do?