[Docker] Run, Stop and Remove Docker Containers

Source: Internet
Author: User
Tags docker ps docker hub docker run

In this lesson, we'll find out the basics of running Docker containers. We'll go to the download images from Docker Hub, what's happens when you stop containers, how to restart a container on Ce 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 would output the console log in the command line

Another-to-run Docker is in the Backage:

Docker run-d MONGO

To stop a container running:

Docker Stop <container id>

To varify there are 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 is stop first, then you can remove it.

[Docker] Run, Stop and Remove Docker Containers

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.