First, install some pre-requisites for containerd:
    $ sudo apt-get update \
    && sudo apt-get install -y apt-transport-https \
    ca-certificates curl software-properties-common

    ubuntu安装 containerd - 图1
    The overlay and br_netfilter modules are required to be loaded:
    $ cat <overlay
    br_netfilter
    EOF
    ubuntu安装 containerd - 图2
    $ sudo modprobe overlay \
    && sudo modprobe br_netfilter

    ubuntu安装 containerd - 图3
    Setup the required sysctl parameters and make them persistent:
    $ cat <net.bridge.bridge-nf-call-iptables = 1
    net.ipv4.ip_forward = 1
    net.bridge.bridge-nf-call-ip6tables = 1
    EOF
    ubuntu安装 containerd - 图4
    $ sudo sysctl —system

    ubuntu安装 containerd - 图5
    Now proceed to setup the Docker repository:
    $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key —keyring /etc/apt/trusted.gpg.d/docker.gpg add -

    ubuntu安装 containerd - 图6
    $ sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu \
    $(lsb_release -cs) \
    stable”

    Install containerd:
    $ sudo apt-get update \
    && sudo apt-get install -y containerd.io

    ubuntu安装 containerd - 图7
    Create a default config.toml:
    $ sudo mkdir -p /etc/containerd \
    && sudo containerd config default | sudo tee /etc/containerd/config.toml

    ubuntu安装 containerd - 图8
    Configure containerd to use the systemd cgroup driver with runc by editing the configuration file and adding this line:
    [plugins.”io.containerd.grpc.v1.cri”.containerd.runtimes.runc.options]
    SystemdCgroup = true
    ubuntu安装 containerd - 图9
    Now restart the daemon:
    $ sudo systemctl restart containerd