centos7安装docker

原文链接: https://www.cnblogs.com/informatics/p/8276172.html
yum install -y docker
//查看是否安装成功
yum list installed|grep docker

启动

systemctl start docker

查看状态

systemctl status docker

关闭

systemctl stop docker

重启

systemctl restart docker

 

错误:got permission denied while trying to connect to the Docker daemon...

解决方法 :https://www.cnblogs.com/informatics/p/8276172.html

 

docker更换镜像源

登陆aliyun, 找到容器镜像服务,获取加速地址。在/etc/docker/daemon.json下添加

{
  "registry-mirrors": ["https://****.mirror.aliyuncs.com"]
}

重启服务

systemctl daemon-reload

systemctl restart docker

 

修改默认目录

在/etc/docker/daemon.json文件加入

{
  "registry-mirrors": ["https://****.mirror.aliyuncs.com"],
  "graph": "your path"
}

(1)停止docker 服务

systemctl stop docker

(2)移动数据到新的存储路径

cp -rf /var/lib/docker  你的路径

(3)启动docker服务

systemctl start docker

你可能感兴趣的:(docker)