官网下载安装包
https://github.com/containerd/containerd/releases/tag/v1.3.0
containerd-1.3.0.linux-amd64.tar.gz
解压二进制包并生成默认文件
tar -xvf containerd-1.3.0.linux-amd64.tar.gz -C /usr/local/ mkdir /etc/containerd containerd config default> /etc/containerd/config.toml
生成的默认配置文件注意[grpc]的地址字段默认为/run/containerd/containerd.sock
配置文件其他参数含义参照github地址:https://github.com/containerd/containerd/blob/master/docs/man/containerd-config.toml.5.md
配置containerd服务
cat /usr/lib/systemd/system/containerd.service
[Unit]
Description=containerd container runtime
Documentation=https://containerd.io
After=network.target
[Service]
ExecStartPre=/sbin/modprobe overlay
ExecStart=/usr/local/bin/containerd
Delegate=yes
KillMode=process
LimitNOFILE=1048576
# 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
[Install]
WantedBy=multi-user.target
启动服务
systemctl enable containerd
systemctl start containerd
systemctl status containerd