2、Docker自動(dòng)化安裝

一、環(huán)境設(shè)置

1.1、系統(tǒng)設(shè)置

OS :Centos 8

ip和域名設(shè)定

192.168.25.75? k8s-master.zhouyihua.com

192.168.25.76 k8s-node1.zhouyihua.com

192.168.25.77 k8s-node2.zhouyihua.com

1.2、卸載podman,系統(tǒng)默認(rèn)安裝了podman容器和docker有沖突

#!/bin/bash

#zhouyihua

#v0.1

#2021-09-05

yum remove podman -y

yum erase podman buildah -y

setenforce 0

sed -i? 's/^SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

#DISABLE SWAP

swapoff -a

sed -i 's/.*swap.*/#&/' /etc/fstab

systemctl stop firewalld.service

systemctl disable firewalld.service

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo

yum install -y yum-utils device-mapper-persistent-data lvm2 net-tools

yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

wget https://download.docker.com/linux/centos/7/x86_64/edge/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm

yum install containerd.io-1.2.6-3.3.el7.x86_64.rpm -y

mkdir -p /etc/docker

vim /etc/docker/daemon.json << EOF

{

? "registry-mirrors" : ["https://mj9kvemk.mirror.aliyuncs.com"]

}

EOF

yum -y install docker-ce

systemctl daemon-reload && systemctl start docker

systemctl enable docker

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容