Home  >  Article  >  Operation and Maintenance  >  How to check which containers docker has

How to check which containers docker has

尚
Original
2020-03-30 13:41:2228127browse

How to check which containers docker has

You can use the docker ps -a command to list all docker containers, including those that are not running.

Display containers in all states:

$ docker ps -a

There are 7 states of containers: created|restarting|running|removing|paused|exited|dead.

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.

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 check which containers docker has. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn