author : headsen chen
date : 2019-03-06 16:36:12
apt-get remove docker docker-engine docker-ce docker.io # 删除旧的docker的安装包 apt-get update # 更新安装包索引 apt-get install -y apt-transport-https ca-certificates curl software-properties-common # 安装以下包以使apt可以通过HTTPS使用存储库(repository) curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - # 添加Docker官方的GPG密钥: add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" # 使用下面的命令来设置stable存储库 apt-get update # 更新一下apt包索引 apt-get install -y docker-ce # 安装最新版本的Docker CE: apt-cache madison docker-ce # 列出可用的版本: # 选择要安装的特定版本,第二列是版本字符串,第三列是存储库名称,它指示包来自哪个存储库,以及扩展它的稳定性级别。要安装一个特定的版本,将版本字符串附加到包名中,并通过等号(=)分隔它们:
# $ sudo apt-get install docker-ce=<VERSION>
systemctl status docker # 查看 docker 服务的启动状态
ps -ef |grep docker
docker run hello-world docker ps -a