我用的虚拟机是CentOS7, Docker版本是docker-ce-17.03.0
下载完成后直接在虚拟机里yum就好
然后:systemctl start docker 运行docker
systemctl enable docker 开机自启
docker run hello-world 如果能看到 hello from docker说明安装成功
(也没什么好讲的。。)
Docker加速配置
登录阿里云Docker官网:https://dev.aliyun.com/search.html 注册个加速的ID
cp /lib/systemd/system/docker.service /etc/systemd/system/docker.service
chmod 777 /etc/systemd/system/docker.service
vim /etc/systemd/system/docker.service
在文件里添加
ExecStart=/usr/bin/dockerd-current --registry-mirror=https://【你的加速ID】.mirror.aliyuncs.com
重载管理脚本: systemctl daemon-reload
systemctl restart docker
ps -ef | grep docker