It's a memorandum of studying and researching because I'm using Docker for the first time. If there is something I have researched or learned, I will add it as needed.
docker container run Docker image name execute command
① ② ③
① Create and execute a container 2 Original docker image ③ Command to be executed in the container
Check version
docker version
Execution status check
docker system info
Disk usage
docker system df
Image download (Nginx)
docker pull nginx
Launch Nginx with image
docker container run --name webserber -d -p 80:80 nginx
Check the status of the server
docker container ps
Detailed confirmation of container
docker container status webserber
Stop the server
docker stop webserber
Start the server
docker start webserber
Search nginx images from docker hub
docker search nginx
Delete image
docker image rm image name
Creating a container
docker container create
Create / start container
docker container run
Interactive execution
docker container run -it --name "test1" centos /bin/cal
Background execution
docker container run -d centos /bin/ping localhost
Port mapping
docker container run -d -p 8080:80 nginx
Delete unnecessary images (none guy)
docker rmi $(docker images -f dangling=true -q)
Enter the container
docker exec -i -t container name bash
Build by specifying a file
docker build -f Dockerfile path-t image name.
Do not use cache
docker build -f Dockerfile path-t image name. --no-cache
Recommended Posts