Ubuntu 安装docker
- 更新软件包索引
sudo apt-get update
- 安装apt-transport-https ca-certificates curl software-properties-common四个组件实现包管理器对https的访问。
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
- 添加Docker官方GPG密钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- 添加Docker的稳定版本仓库
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- 再次更新软件包索引
sudo apt-get update
- 安装Docker CE(community edition)
sudo apt-get install docker-ce
- 验证Docker是否安装成功并运行
sudo system