修改CentOS7初始化脚本位置, 增加Docker脚本
This commit is contained in:
parent
3e784a70b6
commit
a28ef310eb
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.idea
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# curl -o init.sh https://git.zykeji.club/open/server-init/raw/master/CentOS/7/centos-7-init-1.1.sh && sh init.sh
|
||||
# curl -o init.sh https://git.zykeji.club/open/server-init/raw/master/CentOS/7/all/centos-7-init-1.1.sh && sh init.sh
|
||||
|
||||
read -p "是否安装宝塔?(y/n)" isBaota
|
||||
read -p "是否安装Docker?(y/n)" isDocker
|
28
CentOS/7/docker/docker-centos-7-install-1.0.sh
Normal file
28
CentOS/7/docker/docker-centos-7-install-1.0.sh
Normal file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/bash
|
||||
|
||||
# curl -o init.sh https://git.zykeji.club/open/server-init/raw/master/CentOS/7/docker/docker-centos-7-install-1.0.sh && sh init.sh
|
||||
|
||||
echo "安装Docker"
|
||||
echo "清除旧版本"
|
||||
yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
|
||||
yum remove docker-ce
|
||||
echo "安装相关依赖"
|
||||
yum install -y yum-utils device-mapper-persistent-data lvm2
|
||||
echo "配置YUM源加速"
|
||||
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
|
||||
echo "安装Docker"
|
||||
yum install -y docker-ce docker-ce-cli containerd.io
|
||||
echo "启动并设置自启"
|
||||
systemctl start docker
|
||||
systemctl enable docker
|
||||
echo "设置Docker镜像加速"
|
||||
mkdir -p /etc/docker
|
||||
tee /etc/docker/daemon.json <<-'EOF'
|
||||
{
|
||||
"registry-mirrors": ["https://qu3lgucz.mirror.aliyuncs.com"]
|
||||
}
|
||||
EOF
|
||||
echo "刷新配置"
|
||||
systemctl daemon-reload
|
||||
systemctl restart docker
|
||||
echo "Docker安装完成"
|
Loading…
Reference in New Issue
Block a user