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