docker系列----安装篇

环境准备 centos7.2
1、yum install docker-ce.x86_64 -y
安装完后
执行
systemctl enable docker
2、替换docker镜像保存目录与日志

  1. systemctl restart docker
  2. vim /etc/docker/daemon.json

    {
    "registry-mirrors": ["https://registry.docker-cn.com"],
    "graph":"/data/tools/docker",
    "log-driver": "json-file",
      "log-opts": {
        "max-size": "10m"
      }
    }
    
  3. 如果存在/etc/sysconfig/docker 编辑内容:

    OPTIONS='--selinux-enabled  --signature-verification=false'

3、启动docker

systemctl daemon-reload
systemctl start docker

4、查看docker运行状态

systemctl status docker

5、安装docker-compose

sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
    原文作者:黑白灰0010
    原文地址: https://segmentfault.com/a/1190000020058672
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞