# 此安装文档适用于Centos7.0以上的操作系统:
# 安装文件(存放于Docker安装文件夹):docker-ce-18.03.0.ce-1.el7.centos.x86_64.rpm
# 关闭防火墙和Selinux
root@localhost:~#systemctl stop firewalld.service
root@localhost:~#systemctl disable firewalld.service
# 关闭selinux
root@localhost:~#vi /etc/sysconfig/selinux
SELINUX=disabled
# 创建安装文件临时存放目录
root@localhost:~#mkdir -p /data/src
#在本地shell上传文件docker-ce-18.03.0.ce-1.el7.centos.x86_64.rpm到/data/src下:
scp Docker安装文件/* root@192.168.41.161:/data/src
#(或直接在Centos中下载
root@localhost:~#yum -y install wget
root@localhost:~#wget https://xxx
)
# 安装:
root@localhost:~#yum install /data/src/docker-ce-18.03.0.ce-1.el7.centos.x86_64.rpm
# 安装过程中,此步需要输入 y,然后回车。
Is this ok [y/d/N]: y
# 配置Docker监听:
root@localhost:~#systemctl edit docker.service
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock
root@localhost:~#systemctl daemon-reload
root@localhost:~#systemctl restart docker.service
# 验证Docker是否启用:
root@localhost:~#ps aux |grep dockerd
root 2784 0.6 0.2 1136224 70684 ? Ssl 17:53 0:00 /usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock
#确认 docekr 服务 active
root@localhost:~#service docker status
# 配置Docker开机自动启动:
root@localhost:~#systemctl enable docker