k8s记录-docker-compose脚本参考

#!/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
posted @ 2020-04-30 08:46  信方  阅读(534)  评论(0编辑  收藏  举报