Docker Command(CheatSheet)
By - SANDEEP KUMAR PATEL
What is Docker?
Docker is an open source project that makes it easy to create containers and container-based apps. Originally built for Linux, Docker now runs on Windows and MacOS as well. To understand how Docker works, let’s take a look at some of the components you would use to create Docker-containerized applications.
Docker architecture
Docker uses a client-server architecture. The Docker?client?talks to the Docker?daemon, which does the heavy lifting of building, running, and distributing your Docker containers. The Docker client and daemon?can?run on the same system, or you can connect a Docker client to a remote Docker daemon. The Docker client and daemon communicate using a REST API, over UNIX sockets or a network interface. Another Docker client is Docker Compose, that lets you work with applications consisting of a set of containers.
Docker Commands
Lifecycle Commands
docker create [IMAGE]
docker rename [CONTAINER_NAME] [NEW_CONTAINER_NAME]
docker run [IMAGE] [COMMAND]
docker run --rm [IMAGE]
docker run -td [IMAGE]
docker run -it [IMAGE]
docker run -it-rm [IMAGE]
docker exec -it [container]
docker rm [CONTAINER]
docker update [CONTAINER]
Starting and Stopping Containers
docker start [CONTAINER]
docker stop [CONTAINER]
docker restart [CONTAINER]
docker pause [CONTAINER]
docker unpause [CONTAINER]
docker wait [CONTAINER]
docker kill [CONTAINER]
docker attach [CONTAINER]
Docker Image Commands
docker build [URL/FILE]
领英推荐
docker build -t <tag> [URL/FILE]
docker pull [IMAGE]
docker push [IMAGE]
docker import [URL/FILE]
docker commit [CONTAINER] [NEW_IMAGE_NAME]
docker rmi [IMAGE]
docker load [TAR_FILE/STDIN_FILE]
docker save [IMAGE] > [TAR_FILE]
Docker Container And Image Information
docker ps
docker ps -a
docker logs [CONTAINER]
docker inspect [OBJECT_NAME/ID]
docker events [CONTAINER]
docker port [CONTAINER]
docker top [CONTAINER]
docker stats [CONTAINER]
docker diff [CONTAINER]
docker [image] ls
docker history [IMAGE]
Network Commands
docker network ls
docker network rm [NETWORK]
docker network inspect [NETWORK]
docker network connect [NETWORK] [CONTAINER]
docker network disconnect [NETWORK] [CONTAINER]
Thank You For your Time....!!!!