官方文档
先来份Ubuntu 下安装 docker 的官方文档 -> Get Docker CE for Ubuntu
官方文档的安装方式是最靠谱的,但是对于国内的小伙伴来说墙是硬伤...
国内安装技巧
先来看看2个镜像站:
- 阿里云开源镜像站
https://mirrors.aliyun.com/
- 这是公网开放的,不在阿里云内网的服务器可以考虑使用这个 - 阿里云内网开源镜像站
http://mirrors.cloud.aliyuncs.com
- 这是仅供阿里云内网使用的,比如阿里云ECS服务器就可以访问,相当于局域网,速度会快很多很多,而且不算公网流量带宽.
下面见操作:以阿里云ECS服务器 & Ubuntu 16.04 下安装 Docker CE 为例...
# 操作上同官方文档是一致的,就是镜像源替换成*阿里云内网开源镜像站*而已.
#
apt update
#
apt full-upgrade -y
#
apt install apt-transport-https ca-certificates curl software-properties-common -y
#
curl -fsSL http://mirrors.cloud.aliyuncs.com/docker-ce/linux/ubuntu/gpg | apt-key add -
#
add-apt-repository
"deb [arch=amd64] http://mirrors.cloud.aliyuncs.com/docker-ce/linux/ubuntu
$(lsb_release -cs)
stable"
#
apt update
#
apt install docker-ce -y
搞定,开始你的docker-ce
之旅吧...