Docker快速部署檔案
1.安裝/更新wget鏡像
yum install wget -y
2.洗掉舊版本docker
yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
3.配置鏡像
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
4.鏡像清除快取重啟
yum clean all
yum makecache
5.安裝相關工具
yum install -y bash-completion vim lrzsz wget expect nettools nc nmap tree dos2unix htop iftop iotop unzip telnet slpsmisc nethogs glances bc ntpdate openldap-devel
6.開啟linux內核流量轉發(撰寫檔案進去)
cat <<EOF > /etc/sysctl.d/docker.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.all.rp_filter = 0
net.ipv4.ip_forward=1
EOF
7.修改內核引數和修改組態檔
modprobe br_netfilter
sysctl -p /etc/sysctl.d/docker.conf
8.配置docekr鏡像
curl -o /etc/yum.repos.d/docker-ce.repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
curl -o /etc/yum.repos.d/Centos-7.repo http://mirrors.aliyun.com/repo/Centos-7.repo
9.清除快取重啟
yum clean all && yum makecache
10.docker安裝
yum install docker-ce-20.10.6 -y
11.查看yum源可下載版本
yum list docker-ce --showduplicates | sort -r
12.卸載docker
yum remove -y docker-xxx
13.安裝完后需要配置docker鏡像倉庫
mkdir -p /etc/docker
touch /etc/docker/daemon.json
vim /etc/docker/daemon.json
cat /etc/docker/daemon.json
{
"registry-mirrors" : ["https://8xpk5wnt.mirror.aliyuncs.com"]
}
14.重新啟動docker并設為開機自啟動
systemctl daemon-reload
systemctl enable docker
systemctl restart docker
——docker容器安裝完成————
接下來是部署應用環節~~~
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/347248.html
標籤:其他
上一篇:青龍面板之短信登錄非阿東,開源專案之nvjdc安裝教程。
下一篇:Docker+jenkins+gitee+springboot實作自動化部署流程(詳細教程)(附下載工具地址)(1)
