首页 > 其他 > 详细

[Docker] Run, Stop and Remove Docker Containers

时间:2016-12-02 07:42:28      阅读:269      评论:0      收藏:0      [点我收藏+]

In this lesson, we‘ll find out the basics of running Docker containers. We‘ll go over how to download images from Docker Hub, what happens when you stop containers, how to restart a container once it‘s been stopped, and also how to remove containers.

 

Run a container:

docker run mongo  // run the container, if container not exists, download from hub

This will output the console log in the command line

 

Another way to run docker is in the backage:

docker run -d mongo

 

To stop a container running:

docker stop <container id>

 

To varify there is not container running:

docker ps

 

List all the container regarelss running or not:

docker ps -a

 

Start an container:

docker start <container_id>

 

Remove an container:

docker rm <container_id>

Notice that container shoud be stop first, then you can remove it.

 

[Docker] Run, Stop and Remove Docker Containers

原文:http://www.cnblogs.com/Answer1215/p/6124316.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!