linux安装containerd和nerdctl
目前nerdctl最新版是1.7.2, containerd 1.7.11
nerdctl-full-1.7.2中包含了containerd 1.7.11,cni, nerdctl,所以直接下载这个包即可,如果nerdctl有更新,可以把以下代码中的1.7.2替换为对应版本号即可
对于root用户
wget https://ghproxy.net/https://github.com/containerd/nerdctl/releases/download/v1.7.2/nerdctl-full-1.7.2-linux-amd64.tar.gz tar Cxzvf /usr/local nerdctl-full-1.7.2-linux-amd64.tar.gz cp /usr/local/lib/systemd/system/*.service /etc/systemd/system/ systemctl enable buildkit containerd systemctl start buildkit containerd
对于非root用户
wget https://ghproxy.net/https://github.com/containerd/nerdctl/releases/download/v1.7.2/nerdctl-full-1.7.2-linux-amd64.tar.gz
sudo tar Cxzvf /usr/local nerdctl-full-1.7.2-linux-amd64.tar.gz
sudo apt install uidmap
containerd-rootless-setuptool.sh install
注意,这个rootless-setuptool目前不支持centOS 7及其以下。
完成后nerdctl的使用方法就和docker基本一致
nerdctl compose与docker-compose 用法基本一致