1.移除旧内核模块
sudo apt-get remove docker \
docker-engine \
docker.io
2. 添加https传输包
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
3.添加密钥
curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
4.添加docker软件源
sudo add-apt-repository \
"deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu \
$(lsb_release -cs) \
stable"
5.安装docker-ce
sudo apt-get update
sudo apt-get install docker-ce
6.启动
sudo systemctl enable docker
sudo systemctl start docker
7.查看docker 版本 docker version
8.开启远程
sudo vi /etc/default/docker
DOCKER_OPTS='-H tcp://0.0.0.0:6000 -H unix:///var/run/docker.sock'
sudo vim /lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd -H fd:// $DOCKER_OPTS
EnvironmentFile=/etc/default/docker