Reputation: 20906
Im trying to create 2 docker process in the background.Both creates
My questions is related to 4) - Why the ubuntu image is not listed when I try 'docker ps'
Upvotes: 0
Views: 1828
Reputation: 264986
docker run ubuntu
without any further args will use the default command for this image the follows the below logic:
-a
will only list the running containers.Note that the process for nginx, rather than being a shell, is a web server that does not depend on stdin.
To see the ubuntu container continue to run, but in the background, you can include the -id
options on the command line, e.g.:
$ docker run -id ubuntu
ef672b3750e62c309afdf656d7d82951d302db79274b7369e620e5381f806654
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ef672b3750e6 ubuntu "/bin/bash" 7 seconds ago Up Less than a second brave_newton
Upvotes: 2