Ubuntu 安装Docker 并配置镜像加速

环境

Ubuntu Server 18.04.1 LTS 64bit

Ubuntu 查看版本

参考链接
Docker安装对Ubuntu版本要求

Docker 安装

卸载原有的版本

sudo apt-get remove docker docker-engine docker.io containerd runc

首次安装配置Docker repository

  1. 升级apt,并允许通过HTTPS使用存储库
sudo apt-get update
sudo apt-transport-https \
  ca-certificates \
  curl \
  gnupg-agent \
  software-properties-common


2. 添加Docker GPG密钥,并验证密钥

curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88

  1. 设置repository
sudo add-apt-repository \
"deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/ \
$(lsb_release -cs) \
stable"

安装Docker

  1. 升级apt
sudo apt-get update
  1. 安装最新版本
sudo apt-get install docker-ce docker-ce-cli containerd.io

验证

service docker status

posted @ 2023-04-25 16:02  伶俐虫虫  阅读(129)  评论(0)    收藏  举报