Some common commands for Docker

Source: Internet
Author: User
Tags docker ps docker run

Docker cleanup Command:

Kill all containers: Docker kill $ (Docker ps-q);

Clear all Containers: Docker RM $ (Docker ps-a-Q);

Clear all mirrors: Docker rmi $ (Docker images-q-a)

Boot Image: Docker run < related parameters > < mirroring id> < initial command >

Related parameters:

-I: Indicates that the container is running in "interactive mode"
-T: Indicates that the container will enter its command line when it is started
-V: Indicates which directory needs to be mounted to the container, format:-v < host directory >:< container directory >

-D: The/root/run.sh script is executed in "daemon mode", at which point the Tomcat console does not appear on the output terminal.
-P: Represents the port mapping of the host to the container, at which point the 8080 port inside the container is mapped to the 58080 port of the host, exposing 58080 ports to the outside, and can access the 8080 ports inside the container via the Docker bridge.
--name: Represents the container name and is named with a meaningful name.

Docker Images viewing mirrors
Docker PS View Container
Docker ps-a View all containers, including non-running
Docker RM Delete Container
Docker RMI Delete Mirror
Docker build new Mirror
Docker Run Runtime container
Docker Stop stopping container
Docker logs viewing logs
Docker Load Import Mirror
Docker Save Export image
Docker commit container generates mirrors

Docker inspect + container ID or mirror ID can see details, observe working directory, initial command, etc.

Docker exec enters the container

-

Some common commands for Docker

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.