Common Docker Commands Reference
This article provides a comprehensive reference of essential Docker commands, covering basic container operations, image management, volume handling, network configuration, and data management, with brief Chinese descriptions and example usages for each command.
This reference lists essential Docker command-line instructions for managing containers, images, volumes, and networks.
Basic container commands include docker run -it ubuntu bash to create and start a container, docker ps and docker ps -a to list running or all containers, docker stop , docker start , docker restart , docker kill , docker rm , docker exec , docker attach , docker logs , and docker cp for file copying.
Image management commands cover docker pull , docker push , docker images , docker rmi , docker build -t my-image:tag . , docker history , docker inspect , docker tag , docker save , docker load , docker import , and docker export .
Volume and data commands include docker volume create , docker volume ls , docker volume inspect , docker volume rm , docker volume prune , as well as using docker run -v or docker run --mount to attach volumes to containers, and docker service create with volume mounts.
Network configuration commands provide docker network create --driver bridge my_network , docker network ls , docker network rm , docker network inspect , docker network connect , docker network disconnect , docker run --network=my_network , and docker network prune , plus using networks in services.
These commands together form a practical cheat sheet for developers and operators working with Docker containers.
Test Development Learning Exchange
Test Development Learning Exchange
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.