상세 컨텐츠

본문 제목

Containerd 설치

Linux

by 걸어서뉴욕까지 2023. 8. 11. 00:14

본문

구성 환경

  • OS : CentOS-Stream-Release-9.0.21.el9.noarch
  • 설치버전 : containerd github.com/containerd/containerd v1.7.1

 

Containerd 설치

Containerd를 설치하기 위해 아래 사이트에 접속하여 설치하고자 하는 버전을 다운받는다. 

 

containerd – containerd downloads

To install the binaries for containerd version 1.7.2 (latest), click on the Binaries (.tar.gz) button for that version in the Releases table below. That will copy the tarball URL to your clipboard. Use wget to download the tarball and untar it. The table b

containerd.io

 

# 위 페이지에서 Copy한 link의 파일을 wget으로 다운받는다.
wget https://github.com/containerd/containerd/releases/download/v1.7.1/containerd-1.7.1-linux-amd64.tar.gz

# /usr/local 아래에 압축을 풀어준다.
tar Cxzvf /usr/local containerd-1.7.1-linux-amd64.tar.gz

# root로 사용하기 위해 진행했지만 아래부터는 생략해도 무관하다.
mkdir -p ~/.local/bin & cd ~/.local/bin
ln -s /usr/local/bin/containerd containerd
ln -s /usr/local/bin/ctr ctr

# containerd 버전 확인
containerd -v
# containerd github.com/containerd/containerd v1.7.1 1677a17964311325ed1c31e2c0a3589ce6d5c30d

 

Config 등록

containerd-config.toml를 참고하여 containerd의 config 파일을 생성한다. 

containerd config default > /etc/containerd/config.toml

 

Systemctl Service 등록

service 등록을 위해 /usr/lib/systemd/system/containerd.service 파일을 아래를 참고하여 생성한다.

# Copyright The containerd Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

[Unit]
Description=containerd container runtime
Documentation=https://containerd.io
After=network.target local-fs.target

[Service]
#uncomment to enable the experimental sbservice (sandboxed) version of containerd/cri integration
#Environment="ENABLE_CRI_SANDBOXES=sandboxed"
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/local/bin/containerd

Type=notify
Delegate=yes
KillMode=process
Restart=always
RestartSec=5
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNPROC=infinity
LimitCORE=infinity
LimitNOFILE=infinity
# Comment TasksMax if your systemd version does not supports it.
# Only systemd 226 and above support this version.
TasksMax=infinity
OOMScoreAdjust=-999

[Install]
WantedBy=multi-user.target

※ 위의 샘플은 containerd Getting started with containerd에서 제공되는 샘플입니다.

 

systemctl daemon reload 후 시스템 재시작시 자동으로 실행될 수 있도록 containerd 서비스를 enable 시킨다.

# daemon reload && enable, start
systemctl daemon-reload
systemctl enable --now containerd	# systemctl start containerd (containerd 시작만 원할시)

# containerd status 확인
systemctl status containerd

 

※ 참고

 

nerdctl 설치

구성 환경 OS : CentOS-Stream-Release-9.0.21.el9.noarch CRI : containerd github.com/containerd/containerd v1.7.1 설치버전 : nerdctl version 1.4.0 nerdctl 설치 nerdctl은 containerd에서 뒷글자 nerd에 control를 붙인 명령어로 docker와

minsoo3380.tistory.com

 

'Linux' 카테고리의 다른 글

CentOS NFS 설정  (0) 2023.09.04
nerdctl 설치  (0) 2023.08.11
Linux ssh 보안 설정  (0) 2023.08.05

관련글 더보기