码迷,mamicode.com
首页 > 其他好文 > 详细

[Docker] Run, Stop and Remove Docker Containers

时间:2016-12-02 07:43:00      阅读:183      评论:0      收藏:0      [点我收藏+]

标签:top   download   mon   tput   line   div   ons   less   his   

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

标签:top   download   mon   tput   line   div   ons   less   his   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!