Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use docker to view running containers

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

In this article, the editor introduces in detail "how to use docker to view containers in operation". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to use docker to view containers in operation" can help you solve your doubts.

List all running container information:

Docker ps

[root@enlich01 ~] # docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESce2c487c79c6 mysql "docker-entrypoint..." 27 hours ago Up 27 hours 0.0.0.0 docker-entrypoint... 3306-> 3306/tcp, 33060/tcp mysql01

Docker ps [OPTIONS] other parameters

-a: displays all containers, including those that are not running.

-f: filter the displayed content according to the criteria.

-format: a template file that specifies the return value.

-l: displays the recently created container.

-n: lists the most recently created n containers.

-no-trunc: the output is not truncated.

-Q: silent mode, showing only the container number.

-s: displays the total file size.

How to start a container

Docker start ce2c487c79c6

/ / the last string of characters represents the container id

[root@enlich01 ~] # docker start ce2c487c79c6ce2c487c79c6

Add: let's take a look at the Docker startup redis image

View all local containers: docker ps-a

View locally running containers: docker ps

View all mirrors: docker images

Daocker starts the redis image and sets the password: docker run-d-- name redis1-p 6379 redis-- requirepass "gs123456"

Parameter explanation:-d: run in the background-name is the name of the container-p port mapping-requirepass:redis password redis is the image name

After reading this, the article "how to use docker to view running containers" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself to understand it. If you want to know more about related articles, welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report