CentOS7部署19版docker(簡單,可跟做)
1、安裝依賴包
[root@localhost ~]# yum install -y yum-utils device-mapper-persistent-data lvm2
2、設(shè)置阿里云鏡像源
[root@localhost ~]# yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3、安裝Docker-CE
[root@localhost ~]# yum install -y docker-ce
4、關(guān)閉防火墻與增強(qiáng)型安全功能
[root@localhost ~]# systemctl stop firewalld.service [root@localhost ~]# setenforce 0 [root@localhost ~]#
5、開啟服務(wù),并設(shè)為開機(jī)自啟
[root@localhost ~]# systemctl start docker.service [root@localhost ~]# systemctl enable docker.service Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service. [root@localhost ~]#
6、設(shè)置阿里云鏡像加速
(1)進(jìn)入阿里云首頁,選擇登陸,沒有賬號(hào)的可以注冊(cè)一個(gè)

(2)登陸成功后選擇控制臺(tái)

(3)選擇產(chǎn)品與服務(wù),然后選擇容器鏡像服務(wù)

(4)選擇最下面的鏡像加速器,這時(shí)候就可以根據(jù)你的系統(tǒng)提供相應(yīng)的加速器地址了,每個(gè)人都有自己的加速器地址

(5)配置鏡像加速
[root@localhost ~]# cd /etc/docker/ ##如果沒有該目錄,需手動(dòng)創(chuàng)建
[root@localhost docker]# ls
key.json
[root@localhost docker]# tee /etc/docker/daemon.json <<-'EOF' ##配置鏡像加速
> {
> "registry-mirrors": ["https://******.******.aliyuncs.com"]
> }
> EOF
{
"registry-mirrors": ["https://******.*******.aliyuncs.com"]
}
[root@localhost docker]# ls
daemon.json key.json
[root@localhost docker]# systemctl daemon-reload ##重載守護(hù)進(jìn)程
[root@localhost docker]# systemctl restart docker ##重啟docker
[root@localhost docker]#
7、開啟系統(tǒng)的數(shù)據(jù)包轉(zhuǎn)發(fā)功能
[root@localhost docker]# echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf [root@localhost docker]# sysctl -p ##加載配置 net.ipv4.ip_forward = 1 [root@localhost docker]#
以上就是本文的全部內(nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持本站。
版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場(chǎng),如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。
關(guān)注官方微信