- Dockerfile 다단계(multistage) 빌드 연습
- 컨테이너 엔진(docker 또는 containerd 등)
- conatiner CLI(docker 또는 nerdctl/buildkit)
cd my-app
npm start
- multi-stage example
nerdctl build -t multi_stage_example:alpha -f multi_stage_example.Dockerfile .
nerdctl run --rm multi_stage_example:alpha
- stage 1개
# build
nerdctl build -t onestage:alpha -f one_stage.Dockerfile .
# image 확인
nerdctl images onestage:alpha
- stage 2개
# build
nerdctl build -t multi-stage:alpha -f multi_stage.Dockerfile .
# image 확인
nerdctl images multi-stage:alpha