ubuntu18.04 - JB3cm/docker-installation GitHub Wiki

  • 先卸载可能存在的旧版本:

apt-get remove docker docker-engine docker-ce docker.io

  • 更新apt包索引

apt-get update

  • 安装HTTPS存储库

apt-get install -y apt-transport-https ca-certificates curl software-properties-common

  • 添加Docker官方的GPG密钥

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

  • 设置stable存储库

add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

  • 更新apt包索引

apt-get update

  • 安装最新版本的docker

apt-get install -y docker-ce

  • 在生产系统上,可能会需要应该安装一个特定版本的Docker CE,而不是总是使用最新版本。列出可用的版本:

apt list docker-ce -a

  • 选择要安装的特定版本,VERSION指版本

apt-get install docker-ce=<VERSION>

⚠️ **GitHub.com Fallback** ⚠️