Containerd를 설치하기 위해 아래 사이트에 접속하여 설치하고자 하는 버전을 다운받는다.
# 위 페이지에서 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
containerd-config.toml를 참고하여 containerd의 config 파일을 생성한다.
containerd config default > /etc/containerd/config.toml
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
CentOS NFS 설정 (0) | 2023.09.04 |
---|---|
nerdctl 설치 (0) | 2023.08.11 |
Linux ssh 보안 설정 (0) | 2023.08.05 |