linux安装containerd和nerdctl
目前nerdctl最新版是2.0.0-rc.1, containerd 2.0
nerdctl-full-2.0.0-rc.1中包含了containerd 2.0,cni, nerdctl,所以直接下载这个包即可,如果nerdctl有更新,可以把以下代码中的2.0.0-rc.1替换为对应版本号即可
对于root用户
wget https://mirror.ghproxy.com/https://github.com/containerd/nerdctl/releases/download/v2.0.0-rc.1/nerdctl-full-2.0.0-rc.1-linux-amd64.tar.gz tar Cxzvf /usr/local nerdctl-full-2.0.0-rc.1-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://mirror.ghproxy.com/https://github.com/containerd/nerdctl/releases/download/v2.0.0-rc.1/nerdctl-full-2.0.0-rc.1-linux-amd64.tar.gz
sudo tar Cxzvf /usr/local nerdctl-full-2.0.0-rc.1-linux-amd64.tar.gz
containerd-rootless-setuptool.sh install
如果提示exec: "newuidmap": executable file not found in $PATH
. 则需要安装uidmap
注意,这个rootless-setuptool目前不支持centOS 7及其以下。
完成后nerdctl的使用方法就和docker基本一致
nerdctl compose与docker-compose 用法基本一致