Docker Common Commands

Source: Internet
Author: User
Tags docker run

1. View Container logs

Docker Logs-f < container ID or name >

2. Viewing a running container

Ps

3. View all containers

PS -A

4. Delete a single container

RM < container ID or name >

5. Remove all containers

RM PS -a-q)

6. Show All Mirrors

Docker images

7. Delete a single image

Docker RMI < Mirror ID or name >

8. Delete all Mirrors

awk ' {print $} ' sort -R)

9. Remove all mirrors for a specific condition

grep awk ' {print $} ' sort -R)

10. Run a new container, naming it, port mapping, folder mapping

Docker run--name < container name >-p < host port 1>:< container port 1>-p < host port 2>:< container port 2>-d-v < host directory >:< Container Catalog > < mirror name [:tag]>

11. Re-take over the container's console

Docker attach < Container ID or name >

12. Copy files from the container

CP < container ID or name >:< file address in Container > < host directory >

Docker Common Commands

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.