简体   繁体   中英

Docker hello-world container not visible with docker ps command

I succefully ran hello-world using docker run command , but when I check running containers with docker ps , this container was not visble under running containers , Any suggestions

Thank Rajendar

How did you run it? If I remember correctly, the hello world example just echos and quits, so running docker ps immediately afterwards won't show you anything.

Try this instead:

docker ps -n 1

That will essentially show you the most recent container you ran and its state.

The default hello-world image from docker has no extra service running inside it so therefore exits after printing the default text. As such you cannot view it using docker ps which is command for viewing currently running containers.

To view running/stopped containers, run docker ps -a

See the image on how the docker ps and docker ps -a command show different results for the `hello-world image.

码头工人

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM