💡 핵심 요약 (Executive Summary)
본 가이드는 Containerd nerdctl 핵심 가이드 및 실전 아키텍처의 핵심 개념, 실전 구성 명령어 및 아키텍처 베스트 프랙티스를 다룹니다. 클라우드 네이티브 및 인프라 엔지니어링 실무에 즉시 활용 가능하도록 체계적으로 정리했습니다.
📑 Table of Contents
docker와 동일
docker와 다른 점
bash
#로그인시 insecure-registry 사용
nerdctl login --insecure-registry=true $image_registry
#push할 때 isecure-registry 사용
nerdctl push --insecure-registry=true $image_registry/$project/$image:$tag
Feature
prune시 다음의 에러 날 경우
bash
nerdctl system prune --all
ERRO[0000] `buildctl` needs to be installed and `buildkitd` needs to be running, see https://github.com/moby/buildkit error="failed to ping to host unix:///run/buildkit-k8s.io/buildkitd.sock: exec: \"buildctl\": executable file not found in $PATH\nfailed to ping to host unix:///run/buildkit-default/buildkitd.sock: exec: \"buildctl\": executable file not found in $PATH\nfailed to ping to host unix:///run/buildkit/buildkitd.sock: exec: \"buildctl\": executable file not found in $PATH"
WARN[0000] BuildKit is not running. Build caches will not be pruned. error="no buildkit host is available, tried 3 candidates: failed to ping to host unix:///run/buildkit-k8s.io/buildkitd.sock: exec: \"buildctl\": executable file not found in $PATH\nfailed to ping to host unix:///run/buildkit-default/buildkitd.sock: exec: \"buildctl\": executable file not found in $PATH\nfailed to ping to host unix:///run/buildkit/buildkitd.sock: exec: \"buildctl\": executable file not found in $PATH"
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
- all images without at least one container associated to them
- all build cache
Are you sure you want to continue? [y/N] y
WARN[0000] failed to remove container 6f09d6335e846e554e0375156abdc0dedc8941aef7770c53b6383c06d2a4e8e3 error="unexpected end of JSON input"
WARN[0000] failed to remove container 805f0e85ba70fae22fef177915e5dd279a1cce0fa3f91e5f34c72c323f56af74 error="unexpected end of JSON input"
WARN[0001] failed to remove container aca8948c684792bf4e47ba72d0b0cb4fb0772bf6afac2f9d96e8dabe6642f42f error="unexpected end of JSON input"
WARN[0001] failed to remove container c82cd912f929e8eb01a6a7aaecb2de0883f4393b23a0c6b93916448d1c6b3eeb error="unexpected end of JSON input"
- 실패한 컨테이너들은 딱히 용량을 잡아먹진 않는것으로 보임. 필요하면 다음을 참조.
Reference & Guidelines (NOTE)
ctr은 Containerd 전용 로우레벨 CLI툴이다. 사용법이 불편하여 상위 래퍼도구인 nerdctl 이 도커 CLI스펙에 맞추어 생겨났다.
bash
# Kubernetes 네임스페이스 대상일 경우
for id in $(ctr -n k8s.io container ls -q); do
ctr -n k8s.io container delete "$id" 2>/dev/null && echo "Deleted: $id"
done
Leave a Reply