banner
欢迎观看

Ubuntu网络源安装Containerd

Scroll down

本文作者:丁辉

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"

开始安装

  1. 更新包索引

    1
    apt update
  2. 安装 Containerd

    1
    apt install containerd.io -y
  3. 配置 Containerd

    1
    mkdir -p /etc/containerd

    使用默认配置文件

    1
    containerd config default | tee /etc/containerd/config.toml
  4. 修改驱动和镜像地址

    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 # 修改这里用于配置容器运行时使用 systemd 作为 cgroup 驱动 的关键设置

    [plugins.'io.containerd.cri.v1.images'.pinned_images]
    sandbox = 'registry.aliyuncs.com/google_containers/pause:3.10.1'
  5. 启动

    1
    2
    3
    systemctl enable containerd
    systemctl start containerd
    systemctl status containerd
  6. 验证

    1
    ctr info

要是这篇文章为您解了惑、带来了帮助,不妨用小小的打赏来支持下我的创作吧,您的鼓励就是我持续分享的最大动力哦,感谢您啦!

其他文章
cover
Docker部署Node-exporter
  • 70/01/01
  • 00:00
  • Kubernetes-Docker
cover
Docker部署Watchtower管理容器更新
  • 70/01/01
  • 00:00
  • Kubernetes-Docker
目录导航 置顶
  1. 1. Ubuntu网络源安装Containerd
    1. 1.1. Ubuntu部署Containerd配置Apt源
      1. 1.1.1. 安装必须源
      2. 1.1.2. Ubuntu 22.04(现代添加推荐方法)
      3. 1.1.3. Ubuntu 21.10(传统添加方法)
      4. 1.1.4. Ubuntu 21.04(传统添加方法)
      5. 1.1.5. Ubuntu 20.10 (传统添加方法)
      6. 1.1.6. Ubuntu 20.04(传统添加方法)
      7. 1.1.7. Ubuntu 19.10 (传统添加方法)
      8. 1.1.8. Ubuntu 19.04(传统添加方法)
      9. 1.1.9. Ubuntu 18.10(传统添加方法)
      10. 1.1.10. Ubuntu 18.04(传统添加方法)
      11. 1.1.11. Ubuntu 17.10(传统添加方法)
      12. 1.1.12. Ubuntu 16.04(传统添加方法)
    2. 1.2. 开始安装
请输入关键词进行搜索