You can use "docker ps" to find containers in docker.
docker ps: List containers
Syntax
docker ps [OPTIONS]
OPTIONS Description:
-a: Display all containers, including those that are not running.
-f: Filter the displayed content based on conditions.
--format: Specify the template file for the return value.
-l: Display recently created containers.
-n: List the recently created n containers.
--no-trunc: Do not truncate output.
-q: Silent mode, only the container number is displayed.
-s: Display the total file size.
Example:
List all running container information.
runoob@runoob:~$ docker ps CONTAINER ID IMAGE COMMAND ... PORTS NAMES 09b93464c2f7 nginx:latest "nginx -g 'daemon off" ... 80/tcp, 443/tcp myrunoob 96f7f14e99ab mysql:5.6 "docker-entrypoint.sh" ... 0.0.0.0:3306->3306/tcp mymysql
Output details:
CONTAINER ID: Container ID.
IMAGE: The image used.
COMMAND: The command to run when starting the container.
CREATED: The creation time of the container.
STATUS: Container status.
For more related tutorials, please pay attention to the docker tutorial column on the PHP Chinese website.
The above is the detailed content of How to find containers in docker. For more information, please follow other related articles on the PHP Chinese website!