Error[8]: Undefined offset: 2, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

docker和docker-compose一键安装教程(支持在线和离线)

shell脚本

#!/bin/sh
# 当前目录
CURRENT_DIR=$(
 cd "$(dirname "
sed -i 's/\r$//' installDocker.sh
chmod +x installDocker.sh
")" pwd ) #Install docker if which docker >/dev/null; then echo "检测到 Docker 已安装,跳过安装步骤" docker -v echo "启动 Docker " service docker start 2>&1 | tee -a ${CURRENT_DIR}/install.log else if [[ -d "$CURRENT_DIR/docker" ]]; then echo "... 离线安装 docker" cp $CURRENT_DIR/docker/centos-local.tgz /root/ cd /root && tar -xvzf centos-local.tgz cd /root/docker-ce-local &&rpm -ivh createrepo-0.9.9-28.el7.noarch.rpm mkdir -p /etc/yum.repos.d/repobak && mv /etc/yum.repos.d/CentOS* /etc/yum.repos.d/repobak cp $CURRENT_DIR/docker/docker-ce-local.repo /etc/yum.repos.d/docker-ce-local.repo cd /root/docker-ce-local &&createrepo /root/docker-ce-local && yum makecache cd $CURRENT_DIR/docker/ &&yum install -y container-selinux-2.9-4.el7.noarch.rpm &&yum install -y docker-ce echo "... 启动 docker" sudo systemctl start docker 2>&1 | tee -a ${CURRENT_DIR}/install.log echo '{"registry-mirrors":["https://registry.docker-cn.com"]}'>/etc/docker/daemon.json cat /etc/docker/daemon.json service docker restart else echo "... 在线安装 docker" curl -fsSL https://get.docker.com -o get-docker.sh 2>&1 | tee -a ${CURRENT_DIR}/install.log sudo sh get-docker.sh 2>&1 | tee -a ${CURRENT_DIR}/install.log echo "... 启动 docker" service docker start 2>&1 | tee -a ${CURRENT_DIR}/install.log fi fi ##Install Latest Stable Docker Compose Release if which docker-compose >/dev/null; then echo "检测到 Docker Compose 已安装,跳过安装步骤" docker-compose -v else if [[ -d "$CURRENT_DIR/docker-compose" ]]; then echo "... 离线安装 docker-compose" cd $CURRENT_DIR/docker-compose/ && cp docker-compose /usr/local/bin/ chmod +x /usr/local/bin/docker-compose docker-compose -version echo "... 离线安装 docker-compose 成功" else echo "... 在线安装 docker-compose" curl -L "https://github.com/docker/compose/releases/download/1.14.0-rc2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose 2>&1 | tee -a ${CURRENT_DIR}/install.log chmod +x /usr/local/bin/docker-compose ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose docker-compose -version echo "... 在线安装 docker-compose 成功" fi fi

如果脚本复制后使用报下面的错误

请执行

[+++]

在网络条件不好的情况下建议离线安装,请先下载下面的包

离线的安装包
链接: https://pan.baidu.com/s/1ANDM5v-Z1zmljekc4djAdQ

 提取码: 39dm

到此这篇关于docker和docker-compose一键安装(支持在线和离线)的文章就介绍到这了,更多相关docker和docker-compose安装内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 165, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
")"pwd )#Install docker if which docker >" /> ")"pwd )#Install docker if which docker >"> docker和docker-compose一键安装教程_软件运维_内存溢出

阅读 32

docker和docker-compose一键安装教程,第1张

docker和docker-compose一键安装教程(支持在线和离线)
shell脚本

#!/bin/sh # 当前目录 CURRENT_DIR=$( cd "$(dirname "
sed -i 's/\r$//' installDocker.sh chmod +x installDocker.sh

")" pwd ) #Install docker if which docker >/dev/null; then echo "检测到 Docker 已安装,跳过安装步骤" docker -v echo "启动 Docker " service docker start 2>&1 | tee -a ${CURRENT_DIR}/install.log else if [[ -d "$CURRENT_DIR/docker" ]]; then echo "... 离线安装 docker" cp $CURRENT_DIR/docker/centos-local.tgz /root/ cd /root && tar -xvzf centos-local.tgz cd /root/docker-ce-local &&rpm -ivh createrepo-0.9.9-28.el7.noarch.rpm mkdir -p /etc/yum.repos.d/repobak && mv /etc/yum.repos.d/CentOS* /etc/yum.repos.d/repobak cp $CURRENT_DIR/docker/docker-ce-local.repo /etc/yum.repos.d/docker-ce-local.repo cd /root/docker-ce-local &&createrepo /root/docker-ce-local && yum makecache cd $CURRENT_DIR/docker/ &&yum install -y container-selinux-2.9-4.el7.noarch.rpm &&yum install -y docker-ce echo "... 启动 docker" sudo systemctl start docker 2>&1 | tee -a ${CURRENT_DIR}/install.log echo '{"registry-mirrors":["https://registry.docker-cn.com"]}'>/etc/docker/daemon.json cat /etc/docker/daemon.json service docker restart else echo "... 在线安装 docker" curl -fsSL https://get.docker.com -o get-docker.sh 2>&1 | tee -a ${CURRENT_DIR}/install.log sudo sh get-docker.sh 2>&1 | tee -a ${CURRENT_DIR}/install.log echo "... 启动 docker" service docker start 2>&1 | tee -a ${CURRENT_DIR}/install.log fi fi ##Install Latest Stable Docker Compose Release if which docker-compose >/dev/null; then echo "检测到 Docker Compose 已安装,跳过安装步骤" docker-compose -v else if [[ -d "$CURRENT_DIR/docker-compose" ]]; then echo "... 离线安装 docker-compose" cd $CURRENT_DIR/docker-compose/ && cp docker-compose /usr/local/bin/ chmod +x /usr/local/bin/docker-compose docker-compose -version echo "... 离线安装 docker-compose 成功" else echo "... 在线安装 docker-compose" curl -L "https://github.com/docker/compose/releases/download/1.14.0-rc2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose 2>&1 | tee -a ${CURRENT_DIR}/install.log chmod +x /usr/local/bin/docker-compose ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose docker-compose -version echo "... 在线安装 docker-compose 成功" fi fi

如果脚本复制后使用报下面的错误

请执行

在网络条件不好的情况下建议离线安装,请先下载下面的包

离线的安装包

链接: https://pan.baidu.com/s/1ANDM5v-Z1zmljekc4djAdQ

 提取码: 39dm 到此这篇关于docker和docker-compose一键安装(支持在线和离线)的文章就介绍到这了,更多相关

docker和docker-compose安装
内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!

欢迎分享,转载请注明来源:

内存溢出

原文地址:

http://outofmemory.cn/yw/899727.html
离线安装dockercompose
(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
code code 管理员组
docker 安装nacos并配置数据库的教程详解
上一篇
2022-05-15
docker安装rabbitmq无法进入管理页面的问题
2022-05-15

发表评论
请登录后评论... 登录
提交

    评论列表(0条)
保存
{label} {label} ")"pwd)#Install docker if which docker >', author : 'code', cat_name : '软件运维', time_y_m : '2022年05月', time_d : '15', site_motto : '内存溢出' }; {script} {script}