Docker 치트시트
검색하고 인쇄할 수 있는 Docker 참조 자료——이미지, 컨테이너, 실행 옵션, Dockerfile, 볼륨, 네트워크, Compose, 정리. 무료.
Images
10docker pull nginx:latest
Download an image from a registry
docker images
List locally stored images
docker build -t app:1.0 .
Build an image from the current dir
docker tag app:1.0 app:latest
Add a new tag to an existing image
docker rmi app:1.0
Remove a local image
docker history app:1.0
Show the layers of an image
docker inspect app:1.0
Show low-level image details (JSON)
docker save -o app.tar app:1.0
Export an image to a tar archive
docker load -i app.tar
Import an image from a tar archive
docker image prune
Remove dangling (unused) images
Containers
10docker ps
List running containers
docker ps -a
List all containers (incl. stopped)
docker run nginx
Create and start a new container
docker start web
Start a stopped container
docker stop web
Gracefully stop a container
docker restart web
Restart a container
docker kill web
Force-stop a container (SIGKILL)
docker rm web
Remove a stopped container
docker rename web api
Rename a container
docker pause web
Suspend all processes in a container
Run options
11docker run -d nginx
Run detached in the background
docker run -it ubuntu bash
Interactive terminal session
docker run --name web nginx
Assign a custom container name
docker run -p 8080:80 nginx
Map host port to container port
docker run -v data:/var/lib nginx
Mount a named volume
docker run -e ENV=prod app
Set an environment variable
docker run --rm alpine echo hi
Auto-remove after it exits
docker run --network mynet app
Attach to a specific network
docker run --restart unless-stopped app
Restart policy for the container
docker run -w /app node
Set the working directory
docker run --memory 512m --cpus 1.5 app
Limit memory and CPU usage
Exec & logs
10docker exec -it web bash
Open a shell inside a container
docker exec web ls /app
Run a one-off command in a container
docker logs web
Show the container logs
docker logs -f web
Follow (tail) logs in real time
docker top web
List processes running in a container
docker stats
Live resource usage of containers
docker attach web
Attach to a running container
docker cp web:/app/log.txt .
Copy files between host and container
docker port web
Show port mappings for a container
docker inspect web
Show low-level container details
Build & Dockerfile
14FROM node:20-alpine
Base image for the build
WORKDIR /app
Set the working directory
COPY . .
Copy files into the image
ADD app.tar.gz /app
Copy (and auto-extract archives/URLs)
RUN npm install
Execute a command at build time
ENV NODE_ENV=production
Set a persistent environment variable
ARG VERSION=1.0
Build-time argument
EXPOSE 3000
Document the listening port
VOLUME /data
Declare a mount point
USER node
Run as a non-root user
HEALTHCHECK CMD curl -f localhost
Define a container health check
CMD ['node', 'app.js']
Default command (overridable)
ENTRYPOINT ['docker-entrypoint.sh']
Fixed executable for the container
FROM build AS final
Multi-stage build stage reference
Volumes
10docker volume create data
Create a named volume
docker volume ls
List all volumes
docker volume inspect data
Show details of a volume
docker volume rm data
Remove a volume
docker volume prune
Remove all unused volumes
docker run -v data:/app nginx
Mount a named volume
docker run -v $(pwd):/app nginx
Bind-mount the current directory
docker run -v $(pwd):/app:ro nginx
Bind-mount read-only
docker run --mount type=volume,src=data,dst=/app nginx
Mount using the verbose syntax
docker run --tmpfs /tmp nginx
Mount an in-memory tmpfs
Networks
10docker network create mynet
Create a user-defined network
docker network ls
List networks
docker network inspect mynet
Show details of a network
docker network connect mynet web
Connect a container to a network
docker network disconnect mynet web
Disconnect a container from a network
docker network rm mynet
Remove a network
docker network prune
Remove all unused networks
docker network create -d bridge mynet
Create a network with a driver
docker run --network host nginx
Use the host network stack
docker run --network none alpine
Disable networking for a container
Docker Compose
11docker compose up -d
Start all services in the background
docker compose down
Stop and remove the stack
docker compose ps
List the services in the stack
docker compose logs -f
Follow logs from all services
docker compose build
Build or rebuild service images
docker compose pull
Pull the latest service images
docker compose exec web bash
Run a command in a running service
docker compose restart
Restart all services
docker compose stop
Stop services without removing them
docker compose config
Validate and view the merged config
docker compose up --scale web=3
Run multiple replicas of a service
Registry
8docker login
Authenticate to a registry
docker login registry.example.com
Log in to a custom registry
docker logout
Remove stored registry credentials
docker tag app user/app:1.0
Tag an image for a repository
docker push user/app:1.0
Upload an image to a registry
docker pull user/app:1.0
Download an image from a registry
docker search nginx
Search Docker Hub for images
docker manifest inspect nginx
Inspect a multi-arch manifest
System & cleanup
10docker info
Show system-wide Docker information
docker version
Show client and server versions
docker system df
Show Docker disk usage
docker system prune
Remove unused data (safe defaults)
docker system prune -a
Remove all unused images and data
docker container prune
Remove all stopped containers
docker image prune
Remove dangling images
docker volume prune
Remove all unused volumes
docker network prune
Remove all unused networks
docker stats --no-stream
Snapshot of resource usage
“:q”와 일치하는 항목이 없습니다.
Docker 치트시트 소개
이 Docker CLI 치트시트는 컨테이너 작업을 객체별로 정리했습니다: 이미지, 컨테이너, 실행 옵션, exec와 로그, 빌드와 Dockerfile, 볼륨, 네트워크, Docker Compose, 레지스트리 명령어, 시스템 정리까지 포함합니다. 각 행은 완전한 명령어와 한 줄 설명입니다.
Docker 명령어는 길고 플래그가 많습니다 — 포트 매핑, 볼륨 마운트, 환경 변수 — 그리고 정상 동작하는 컨테이너와 혼란스러운 실패의 차이는 종종 플래그 하나입니다. 실행 옵션과 Compose 섹션은 그런 플래그를 외우는 대신 눈에 보이게 유지합니다.
이 시트는 무료이며 클라이언트 사이드로 동작합니다. 검색창으로 명령어를 실시간 필터링하고, 고정된 목차로 섹션 간을 이동하고, 클릭 한 번으로 명령어를 복사하고, 페이지를 인쇄하세요 — 정리 섹션 하나만으로도 디스크 공간을 절약해줄 것입니다.
Docker 치트시트 사용 방법
- 이미지와 컨테이너부터 볼륨과 네트워크를 거쳐 시스템 및 정리까지 섹션을 훑어보세요.
- port, mount, prune 같은 작업을 검색해 명령어를 실시간 필터링하세요.
- 플래그가 많은 명령어를 위해 고정된 사이드바를 통해 실행 옵션이나 Docker Compose로 이동하세요.
- 명령어나 복사 아이콘을 클릭해 복사한 다음 이미지 이름, 포트, 경로를 조정하세요.
- 터미널 옆에 둘 docker 참고 자료로 시트를 인쇄하세요.
자주 묻는 질문
열 개 섹션입니다: 이미지, 컨테이너, 실행 옵션, exec와 로그, 빌드와 Dockerfile, 볼륨, 네트워크, Docker Compose, 레지스트리 명령어, 시스템 정리입니다.
네. 전용 Compose 섹션은 스택을 올리고 내리기, 재빌드, 로그 보기 등 일상 개발에서 사용하는 여러 컨테이너 명령어를 다룹니다.
시스템 및 정리 섹션으로 이동하세요 — 사용하지 않는 컨테이너, 이미지, 볼륨, 네트워크를 제거하는 prune 명령어와 각각 무엇을 삭제하는지에 대한 설명이 나열되어 있습니다.
네. 빌드와 Dockerfile 섹션은 흔히 쓰이는 지시문과 빌드 명령어를 짧은 설명과 짝지어 놓았으며, 빌드된 이미지를 실행할 때 사용할 실행 옵션 섹션과 나란히 있습니다.
네, 완전히 무료입니다 — 검색과 인쇄가 가능하고 계정 없이 브라우저에서 렌더링됩니다.
인기 검색어
docker cheat sheet
docker commands list
docker run options
docker compose commands
dockerfile reference
docker exec into container
docker volumes and networks
docker prune cleanup
도움이 필요하신가요?
이 도구에서 문제를 발견하셨나요? 저희 팀에 알려주세요.