containerd 安装
仓库安装
root@wgs:~# apt update
root@wgs:~# apt -y install containerd
root@wgs:~# systemctl status containerd
二进制安装containerd
下载containerd
下载地址:https://github.com/containerd/containerd/releases
~# export version=1.6.8
~# wget https://github.com/containerd/containerd/releases/download/v${version}/containerd-${version}-linux-amd64.tar.gz
解压containerd
~# tar Cxzvf /usr/local containerd-${version}-linux-amd64.tar.gz
bin/
bin/containerd-shim-runc-v2
bin/containerd-shim
bin/ctr
bin/containerd-shim-runc-v1
bin/containerd
bin/containerd-stress
systemd
https://raw.githubusercontent.com/containerd/containerd/main/containerd.service
/usr/local/lib/systemd/system/containerd.service
[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
启动服务
~# systemctl daemon-reload
~# systemctl enable --now containerd
安装runc
下载地址:https://github.com/opencontainers/runc/releases
~# export runc_version=v1.1.4
~# wget https://github.com/opencontainers/runc/releases/download/${runc_version}/runc.amd64
~# install -m 755 runc.amd64 /usr/local/sbin/runc
安装 CNI plugins
下载cni-plugins
下载地址:https://github.com/containernetworking/plugins/releases
~# export cni_version=v1.1.1
~# wget https://github.com/containernetworking/plugins/releases/download/${cni_version}/cni-plugins-linux-amd64-${cni_version}.tgz
解压cni-plugins
~# mkdir -p /opt/cni/bin
~# tar Cxzvf /opt/cni/bin cni-plugins-linux-amd64-${cni_version}.tgz
./
./macvlan
./static
./vlan
./portmap
./host-local
./vrf
./bridge
./tuning
./firewall
./host-device
./sbr
./loopback
./dhcp
./ptp
./ipvlan
./bandwidth
查看containerd版本
~# containerd --version
containerd github.com/containerd/containerd v1.6.8 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
~# ctr version
Client:
Version: v1.6.8
Revision: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
Go version: go1.17.13
Server:
Version: v1.6.8
Revision: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
UUID: 09fb31c5-01cc-42fa-a1ea-1006056d2976
参考文档
https://github.com/containerd/containerd/blob/main/docs/getting-started.md