Docker common commands include commands for creating and managing containers (docker run, start, stop, restart, rm), commands for managing images (docker build, push, pull, rmi), Commands for viewing and diagnosis (docker ps, logs, top, exec, inspect), and commands for network management (docker network create, connect, disconnect), etc.
Docker Common Commands
Docker is a lightweight containerization platform for packaging and distributing applications program. In order to use Docker effectively, it is important to understand its common commands.
Create and manage containers
-
docker run: Create and run a container.
-
docker start: Start a stopped container.
-
docker stop: Stop a running container.
-
docker restart: Restart a container.
-
docker rm: Delete a container.
Manage images
-
docker build: Build an image from a Dockerfile.
-
docker push: Push the image to the Docker image warehouse.
-
docker pull: Pull the image from the Docker image warehouse.
-
docker rmi: Delete an image.
View and Diagnose
-
docker ps: List running containers.
-
docker logs: View the container’s logs.
-
docker top: View the processes running in the container.
-
docker exec: Execute commands in the container.
-
docker inspect: View the detailed configuration of the container.
Network management
-
docker network create: Create a network.
-
docker network connect: Connect the container to the network.
-
docker network disconnect: Disconnect the container from the network.
Others
-
docker version: Check the Docker version.
-
docker info: View Docker host information.
-
docker help: Get help for the command.
The above is the detailed content of What are the commonly used commands for docker?. For more information, please follow other related articles on the PHP Chinese website!