본문으로 바로 가기
kitlocal.dev

Docker & Compose 치트시트

로컬에서 실행

100% 브라우저에서 처리됩니다. 입력과 출력이 기기 밖으로 나가지 않습니다.

Docker 27+의 컨테이너 수명 주기, 이미지 빌드, 멀티 스테이지 Dockerfile, Compose v2 스택, 네트워크, 볼륨, 로그 및 안전한 정리 명령어.

동작 원리

Images are immutable layered templates; containers are writable runtime processes from an image; volumes persist state across container replacement; networks wire service DNS.

서바이벌 키트

가장 먼저 배워야 할 몇 가지 명령어입니다.

42개 명령어

키보드 단축키/검색창 포커스JK선택 이동C선택 항목 복사F선택 항목 북마크Esc검색 지우기

Run & Inspect Containers

Start containers, map ports, inspect logs, and attach interactive shells.

  • 기본

    Start an ephemeral interactive container and delete it on exit

    docker run --rm -it <image> <shell>

    명령어 만들기

    docker run --rm -it <image> <shell>

    값은 입력한 그대로 삽입됩니다. 공백이나 특수 문자가 포함된 경우 직접 따옴표로 감싸 주세요.

    사용 시점

    Best for throwaway debugging environments without leaving stopped containers behind.

    상세 분석

    --rm
    Automatically remove container once it exits
    -it
    Interactive stdin (-i) + pseudo-TTY (-t)

    예제

    docker run --rm -it alpine:3.20 sh

Images & Multi-Platform Builds

Build, tag, inspect image layers, and manage local registries.

Docker Compose v2

Orchestrate multi-container local stacks cleanly with `docker compose`.

Volumes, Networks & Files

Persist database state, connect containers by service name, and copy files.

Disk Usage & Safe Cleanup

Measure disk consumption and prune unused objects without losing data.

KitLocal 도구에서 사용해 보기

2026. 11. 15.에 확인됨 · Docker Engine CLI 27+ & Compose v2 기준으로 확인됨

출처: Docker CLI Reference · Docker Compose CLI Reference

꺾쇠괄호 안의 내용을 본인의 값으로 바꾸세요. 명령어는 공식 문서에서 가져왔으며, 예제는 명시된 버전에서 실행되었습니다.