本文作者:丁辉
Ubuntu网络源安装Containerd
Ubuntu部署Containerd配置Apt源
我部署 containerd 的时候遇到了各个版本 apt 源无法下载的问题,所以本次记录 Ubuntu 源配置步骤
安装必须源
1
| apt -y install apt-transport-https ca-certificates curl software-properties-common
|
Ubuntu 22.04(现代添加推荐方法)
1 2 3
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
Ubuntu 21.10(传统添加方法)
1 2
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu impish stable"
|
Ubuntu 21.04(传统添加方法)
1 2
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu hirsute stable"
|
Ubuntu 20.10 (传统添加方法)
1 2
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu groovy stable"
|
Ubuntu 20.04(传统添加方法)
1 2
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
|
Ubuntu 19.10 (传统添加方法)
1 2
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu eoan stable"
|
Ubuntu 19.04(传统添加方法)
1 2
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu disco stable"
|
Ubuntu 18.10(传统添加方法)
1 2
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu cosmic test"
|
Ubuntu 18.04(传统添加方法)
1 2
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
|
Ubuntu 17.10(传统添加方法)
1 2
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu artful stable"
|
Ubuntu 16.04(传统添加方法)
1 2
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
|
开始安装
更新包索引
安装 Containerd
1
| apt install containerd.io -y
|
配置 Containerd
1
| mkdir -p /etc/containerd
|
使用默认配置文件
1
| containerd config default | tee /etc/containerd/config.toml
|
修改驱动和镜像地址
1
| vi /etc/containerd/config.toml
|
内容如下(已更新为最新版配置方法,旧版层级不同)
1 2 3 4 5 6 7
| [plugins] ... [plugins.'io.containerd.cri.v1.runtime'.containerd.runtimes.runc.options] SystemdCgroup = true
[plugins.'io.containerd.cri.v1.images'.pinned_images] sandbox = 'registry.aliyuncs.com/google_containers/pause:3.10.1'
|
启动
1 2 3
| systemctl enable containerd systemctl start containerd systemctl status containerd
|
验证