目前nerdctl最新版是1.2.1, containerd 1.6.19
nerdctl-full-1.2.1中包含了containerd 1.6.19,cni, nerdctl,所以直接下载这个包即可,如果nerdctl有更新,可以把以下代码中的1.2.1替换为对应版本号即可
对于root用户
wget https://ghproxy.com/https://github.com/containerd/nerdctl/releases/download/v1.2.1/nerdctl-full-1.2.1-linux-amd64.tar.gz tar Cxzvf /usr/local nerdctl-full-1.2.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://ghproxy.com/https://github.com/containerd/nerdctl/releases/download/v1.2.1/nerdctl-full-1.2.1-linux-amd64.tar.gz
sudo tar Cxzvf /usr/local nerdctl-full-1.2.1-linux-amd64.tar.gz
containerd-rootless-setuptool.sh install
注意,这个rootless-setuptool目前不支持centOS 7及其以下。
完成后nerdctl的使用方法就和docker基本一致
nerdctl compose与docker-compose 用法基本一致