It is not an exhaustive list, but a combination of commands and options used for basic purposes. If you want to know the meaning of each one, I think it will be easier to understand by referring to the following.
Reference -Understanding Docker -Docker command list
Docker Compose
--Create and start a container according to the settings of docker-compose.yml
docker-compose up -d
--Created from Dockerfile
docker-compose up -d --build
--Container start / stop
docker-compose start
docker-compose stop
--Container list display
docker-compose ps
--Container deletion
docker-compose down
--Container confirmation (one-time command execution)
docker-compose run (Service name) (command)
Docker
--Get image from Docker Hub
docker pull (Image name)
--Image list display
docker image ls
--Delete image
docker image rm (Image name)
--Create an image from Dockerfile
docker build -t (Image name) (Directory path where the Dockerfile is located)
--Create a container from an image
docker create --name (Container name) (Image name)
--Launch the container from the image
docker run --rm -it -v (Local directory path):(Container directory path) -p (Local port):(Container port) (Image name) [(Startup process name)]
--Container start / stop
docker start (Container name)
docker stop (Container name)
--Container list display
docker ps -a
--Login to the container
docker exec -it (Container name) bash
--Container log check
docker logs -f (Container name)
--If the container doesn't work
docker run --rm (Container name) bash
--If you want to mount the directory from the middle --Stop the container once, take a snapshot image, add the -v option and start the container again
docker stop (Container name)
docker commit (Container name) (Image name)
docker run (option) (Image name)
Recommended Posts