#!/bin/bash
DIR=`pwd`
PACKAGE_NAME="docker-19.03.15.tgz"
DOCKER_FILE=${DIR}/${PACKAGE_NAME}
centos_install_docker(){
grep "Kernel" /etc/issue &> /dev/null
if [ $? -eq 0 ];then
/bin/echo "当前系统是`cat /etc/redhat-release`,即将开始系统初始化、配置docker-compose与安装docker" && sleep 1
systemctl stop firewalld && systemctl disable firewalld && echo "防火墙已关闭" && sleep 1
systemctl stop NetworkManager && systemctl disable NetworkManager && echo "NetworkManager" && sleep 1
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux && setenforce 0 && echo "selinux 已关闭" && sleep 1
\cp ${DIR}/limits.conf /etc/security/limits.conf
\cp ${DIR}/sysctl.conf /etc/sysctl.conf
/bin/tar xvf ${DOCKER_FILE}
\cp docker/* /usr/bin
\cp containerd.service /lib/systemd/system/containerd.service
\cp docker.service /lib/systemd/system/docker.service
\cp docker.socket /lib/systemd/system/docker.socket
\cp ${DIR}/docker-compose-Linux-x86_64_1.24.1 /usr/bin/docker-compose
groupadd docker && useradd docker -g docker
id -u magedu &> /dev/null
if [ $? -ne 0 ];then
useradd magedu
usermod magedu -G docker
fi
systemctl enable containerd.service && systemctl restart containerd.service
systemctl enable docker.service && systemctl restart docker.service
systemctl enable docker.socket && systemctl restart docker.socket
fi
}
ubuntu_install_docker(){
grep "Ubuntu" /etc/issue &> /dev/null
if [ $? -eq 0 ];then
/bin/echo "当前系统是`cat /etc/issue`,即将开始系统初始化、配置docker-compose与安装docker" && sleep 1
\cp ${DIR}/limits.conf /etc/security/limits.conf
\cp ${DIR}/sysctl.conf /etc/sysctl.conf
/bin/tar xvf ${DOCKER_FILE}
\cp docker/* /usr/bin
\cp containerd.service /lib/systemd/system/containerd.service
\cp docker.service /lib/systemd/system/docker.service
\cp docker.socket /lib/systemd/system/docker.socket
\cp ${DIR}/docker-compose-Linux-x86_64_1.24.1 /usr/bin/docker-compose
ulimit -n 1000000
/bin/su -c - jack "ulimit -n 1000000"
/bin/echo "docker 安装完成!" && sleep 1
id -u magedu &> /dev/null
if [ $? -ne 0 ];then
groupadd -r magedu
groupadd -r docker
useradd -r -m -g magedu magedu
usermod magedu -G docker
fi
systemctl enable containerd.service && systemctl restart containerd.service
systemctl enable docker.service && systemctl restart docker.service
systemctl enable docker.socket && systemctl restart docker.socket
fi
}
main(){
centos_install_docker
ubuntu_install_docker
}
main
优质&青年
- 粉丝: 396
- 资源: 1
最新资源
- jetty-test-policy-javadoc-1.2-10.el7.x64-86.rpm.tar.gz
- jetty-toolchain-1.4-9.el7.x64-86.rpm.tar.gz
- jetty-util-9.0.3-8.el7.x64-86.rpm.tar.gz
- 六载整车仿真经验,分享Cruise与Matlab Simulink联合仿真技巧,远程指导与咨询专业服务,仿真模型展示及定制服务,cruise与matlab sumulink联合仿真远程指导与咨询
- jetty-version-maven-plugin-1.0.7-9.el7.x64-86.rpm.tar.gz
- jetty-version-maven-plugin-javadoc-1.0.7-9.el7.x64-86.rpm.tar.gz
- 三菱MCGS PLC四路抢答器智能控制系统详解:梯形图程序、接线图与组态画面全解析,三菱 MCGS 基于PLC的四路抢答器控制系统 带解释的梯形图程序,接线图原理图图纸,io分配,组态画面 ,核心关键
- jetty-webapp-9.0.3-8.el7.x64-86.rpm.tar.gz
- 基于Matlab Simulink的储能系统变换模型与钒液流电池仿真研究:功能实现及效果展示,基于Matlab Simulink实现了以下功能,搭建了储能系统变模型以及钒液流电池模型,仿真效果较好,系
- jetty-websocket-api-9.0.3-8.el7.x64-86.rpm.tar.gz
- 电火花线切割编程软件EDMCAD源代码解析与Visual C++2008绘图功能展示,电火花线切割编程软件EDMCAD软件源码,源程序,源代码 用Visual C++2008编写的,可以绘图,支持d
- jetty-websocket-client-9.0.3-8.el7.x64-86.rpm.tar.gz
- 基于S7-200 PLC与组态王的邮件分拣控制系统详解:梯形图程序、接线图与组态画面全解析,基于S7-200 PLC和组态王的邮件分拣控制系统 带解释的梯形图程序,接线图原理图图纸,io分配,组态画面
- jetty-websocket-common-9.0.3-8.el7.x64-86.rpm.tar.gz
- S7-1200 PLC改造M7120型平面磨床电气控制系统,提升加工效率与精度,S7-1200 MCGS M7120型平面磨床电气控制系统的PLC改造 ,核心关键词:S7-1200 PLC; MCG
- jetty-websocket-parent-9.0.3-8.el7.x64-86.rpm.tar.gz
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈