Posted 2024-02-29Updated 2024-03-192 minutes read (About 231 words)快速安装containerd和nerdctl1234567891011121314151617181920212223242526272829303132333435# Download# 版本灵活变动export CONTAINERD_VERSION=1.7.13export CNI_PLUGIN_VERSION=v1.4.0export RUNC_VERSION=v1.1.11export NERDCTL_VERSION=1.7.4wget "https://github.com/containerd/containerd/releases/download/v$CONTAINERD_VERSION/containerd-v$CONTAINERD_VERSION-linux-amd64.tar.gz"wget "https://github.com/containernetworking/plugins/releases/download/$CNI_PLUGIN_VERSION/cni-plugins-linux-amd64-$CNI_PLUGIN_VERSION.tgz"wget "https://github.com/opencontainers/runc/releases/download/$RUNC_VERSION/runc.amd64"wget "https://github.com/containerd/nerdctl/releases/download/v$NERDCTL_VERSION/nerdctl-$NERDCTL_VERSION-linux-amd64.tar.gz"# Installtar -Czvxf /usr/local/bin containerd-$CONTAINERD_VERSION-linux-amd64.tar.gzmv /usr/local/bin/bin/* /usr/local/bin/ && rm -rf /usr/local/bin/binmkdir -p /opt/cni/bin && tar Czvxf /opt/cni/bin cni-plugins-linux-amd64-$CNI_PLUGIN_VERSION.tgzchmod 755 runc.amd64 && mv runc.amd64 /usr/local/bin/runctar Czvxf /usr/local/bin nerdctl-$NERDCTL_VERSION-linux-amd64.tar.gz # Configmkdir /etc/containerdcontainerd config default > /etc/containerd/config.tomlvim /etc/containerd/config.toml[plugins."io.containerd.grpc.v1.cri".registry.mirrors] [plugins."io.containerd.grpc.v1.cri".registry.mirrors."k8s.gcr.io"] endpoint = ["https://k8s-gcr.m.daocloud.io"]...# Enable# cp https://github.com/containerd/containerd/blob/v$CONTAINERD_VERSION/containerd.service to /etc/systemd/system/containerd.servicesystemctl daemon-reloadsystemctl enable containerd --now # Testnerdctl info