码迷,mamicode.com
首页 > 其他好文 > 详细

k8s记录-docker-compose脚本参考

时间:2020-04-30 09:46:12      阅读:44      评论:0      收藏:0      [点我收藏+]

标签:pen   services   echo   xxx   div   data   hup   bin   depends   

#!/bin/bash

set -e
base="$(cd `dirname $0`; pwd)"
if [ ! -f "$base/xxx.tar" ];then
    echo "Not xxx images can‘t be load"
    exit
fi
if [ ! -f "$base/xxx.tar" ];then
    echo "Not xxx images can‘t be load"
    exit
fi

if [ ! -d "$base/xxx" ];then
    mkdir -p $base/xxx
fi


docker load < xxx.tar
docker load <xx.tar
docker images
tar xvf xxx.tar.gz -C $base/xxx
nohup docker-compose -f docker_xxx.yml up &
docker ps -a
version: "3"
services:
  xxx:
     image: "xxx"
     ports:
            - "xxx:xxx"
            - "xxx:xxx"
     
     volumes:
            - "./xxx/log:/xxx/logs"
            - "./xxx/data:/xxx"
     container_name: xxx
  xxx:
     image: "xxx"
     links:
            - xxx
     ports:
            - "xxx:xxx"
     depends_on:
            - xxx
     
     volumes:
            - "./xxx/log:/xxx/logs"
            - "./xxx:/xxx"
     container_name: xxx

k8s记录-docker-compose脚本参考

标签:pen   services   echo   xxx   div   data   hup   bin   depends   

原文地址:https://www.cnblogs.com/xinfang520/p/12806629.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!