安装docker
查看软连接,没有则可能导致安装不成功ls -l /sys/class/misc/device-mapper
-
安装基本软件
apt-get update apt-get install apt-transport-https ca-certificates curl software-properties-common -y
-
使用阿里源
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker- ce/linux/ubuntu $(lsb_release -cs) stable"
-
软件源升级
apt-get update
-
安装docker
apt-get install docker-ce -y
注:
可以指定版本安装docker:
apt-get install docker-ce=<VERSION> -y
-
测试docker
docker version
docker加速器配置
-
下载设置镜像的脚本,并执行
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://e5d212cc.m.daocloud.io
-
修改
/etc/docker/daemon.json
文件,增加后边的内容
{"registry-mirrors": ["http://e5d212cc.m.daocloud.io"], "insecure-registries": []}
- 注意:
配置好后重启docker
systemctl restart docker