proj.pe.kr|도커, 쿠버네티스 기본
✔️

Docker vs Containerd

kubernetes 1.24부터 kubernetes 내부에서 docker를 더이상 사용하지 않는다.
대신 containerd를 사용하게 되는데, docker와 차이점을 알아보자.
Kubernetes 1.24: Stargazer
Authors: Kubernetes 1.24 Release Team We are excited to announce the release of Kubernetes 1.24, the first release of 2022! This release consists of 46 enhancements: fourteen enhancements have graduated to stable, fifteen enhancements are moving to beta, and thirteen enhancements are entering alpha. Also, two features have been deprecated, and two features have been removed. Major Themes Dockershim Removed from kubelet After its deprecation in v1.20, the dockershim component has been removed from the kubelet in Kubernetes v1.
https://kubernetes.io/blog/2022/05/03/kubernetes-1-24-release-announcement/#dockershim-removed-from-kubelet

구조

장단점

containerd is a lightweight container runtime, suitable either for limited-resource computing environments or when you’re using a container management system like Kubernetes. Due to its basic interface and lack of ability to build images, it may not be suitable for your development purposes.

중간에 layer가 적기때문에 좀 더 가볍기때문에 제한된 리소스를 써야하는 환경이라면 좀 더 좋을 것이고, 대신 개발 편의성이 떨어진다

Docker offers a full-featured toolkit to build, run, and manage container images and containers in standalone and networked setups. It provides more features than containerd and is more human friendly. Also, Docker uses containerd, which makes it suitable for desktop and continuous integration (CI) build environments. You could use it in production as well if Kubernetes is not available, or if you need isolated network namespaces.

build, run, image관리 등에서 좀 더 편의성이 잘 제공되어있고, CI환경이나 kubernetes환경이 아닌 곳에서 더 편리하게 사용할 수 있다.

Command 차이

docker build, commit, push, run, inspect, ps, image prune...
대부분
crictl로 docker명령어를 대체하는 것이 가능

차이점도 있는데, docker push대신 crictl push는 없고 ctr이라는 containerd 클라이언트 툴을 사용해야 함.

crictl에서는 crictl pods, runp, stopp 와 같은 pod에 좀 더 친화적인 기능을 제공 (도커에선 없는 기능)

docker vs crictl 명령어 비교

기능dockercrictl비고
컨테이너
컨테이너 목록docker pscrictl ps
컨테이너 생성docker createcrictl create
컨테이너 시작 / 정지docker start / stopcrictl start / stop
컨테이너 삭제docker rmcrictl rm
컨테이너 생성 + 실행docker runcrictl runcrictl은 컨테이너·Pod 설정 파일(json/yaml)이 필요하다
컨테이너 안에서 명령 실행docker execcrictl exec
실행 중인 컨테이너에 연결docker attachcrictl attach
로그 확인docker logscrictl logs
상세 정보docker inspectcrictl inspect
리소스 사용량docker statscrictl stats
리소스 제한 변경docker updatecrictl update
이미지
이미지 목록docker imagescrictl images
이미지 다운로드docker pullcrictl pull
이미지 삭제docker rmicrictl rmi
이미지 상세 정보docker inspectcrictl inspecticrictl은 이미지용 명령이 따로 있다
사용하지 않는 이미지 정리docker image prunecrictl rmi --prune
이미지 업로드docker push없음ctr images push 사용 (containerd 클라이언트)
이미지 태그docker tag없음ctr images tag 사용
이미지 빌드docker build없음crictl은 빌드를 지원하지 않는다. buildah, nerdctl 등 별도 도구 사용
컨테이너를 이미지로 저장docker commit없음crictl은 지원하지 않는다
Pod (crictl 전용)
Pod 목록없음crictl pods
Pod 실행없음crictl runpPod 설정 파일로 Pod(sandbox) 생성
Pod 정지 / 삭제없음crictl stopp / rmp
Pod 상세 정보없음crictl inspectp
Pod 포트 포워딩없음crictl port-forward
시스템
런타임 정보docker infocrictl info
버전 확인docker versioncrictl version