The Docker Desktop application is awesome to work with containers locally via a graphical interface.
You are not required to use it. You can use the CLI commands.
The docker ps
command lists the currently running containers:
This is the same as running
_docker container ls_
.
In this case, container with name node-app
and ID 739037a911e0
generated from the image examplenode
, created 4 minutes ago
, is up since 4 minutes, and the port 80 of the host machine is mapped to the container port 3000 using the TCP protocol.
When you know the contained ID, you can stop the container by running
docker container stop <ID>
Once a container is stopped, you can see it using docker container ls -a
:
And you can remove it using docker container rm
:
docker container rm <ID>
You can inspect all the details about a container running docker inspect
:
#docker #docker containers #command line