# 此安裝文檔適用于Centos7.0以上的操作系統(tǒng):
# 安裝文件(存放于Docker安裝文件夾):docker-ce-18.03.0.ce-1.el7.centos.x86_64.rpm
# 關(guān)閉防火墻和Selinux
root@localhost:~#systemctl stop firewalld.service
root@localhost:~#systemctl disable firewalld.service
# 關(guān)閉selinux
root@localhost:~#vi /etc/sysconfig/selinux
SELINUX=disabled
# 創(chuàng)建安裝文件臨時(shí)存放目錄
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監(jiān)聽:
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
# 驗(yàn)證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
#確認(rèn) docekr 服務(wù) active
root@localhost:~#service docker status
# 配置Docker開機(jī)自動(dòng)啟動(dòng):
root@localhost:~#systemctl enable docker