Share images, automate workflows, and more with
a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
In Example 13-3, Docker looks for the container image
hello-world and can’t find it in the local image store.
Since it has never downloaded it before, it defaults to the
Docker Hub registry, does a lookup, finds the image, and
then downloads (or pulls, in Docker speak) the latest
one. It then starts the container and prints to the console
a message saying that the Docker installation is working
as expected. Since you now have a container that has
been executed, you can use the subcommand ls to see
what is running:
Click here to view code image
$ docker container ls
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
Unfortunately, you don’t see any active containers. That
is because the one that was launched ran, printed the
message, and then ended. To see containers that have
been run but are now stopped, you have to add the -a
flag to ls:
Click here to view code image
$ docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
bac0c2a2cca8 hello-world "/hello" 43 minutes
ago Exited(0) 43 minutes ago
Now you can see the container ID, the image name, the
command that was issued, and its current status, which