Docker 安装

一、安装docker

yum install docker

二、配置 Docker Remote API

vim /usr/lib/systemd/system/docker.service

 直接在 ExecStart 启动参数的 /usr/bin/dockerd 后面添加以开启 TCP 连接:-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock

三、重新加载

systemctl daemon-reload docker

systemctl start docker

问题

执行启动命令: systemctl   start docker  ,报下面错误:

Error starting daemon: SELinux is not supported with the overlay2 graph driver on this kernel. Either boot into a newer kernel or disable selinux in docker (--selinux-enabled=false)

解决

vi /etc/sysconfig/docker
# /etc/sysconfig/docker

# Modify these options if you want to change the way the docker daemon runs

OPTIONS='--selinux-enabled=false  --log-driver=journald --signature-verification=false'
if [ -z "${DOCKER_CERT_PATH}" ]; then
    DOCKER_CERT_PATH=/etc/docker
fi

然后重启:systemctl  restart  docker

你可能感兴趣的:(Linux)