脚本启动shipyard

1、编辑一个sh文件:

vim /root/shipyard_start.sh


2、shipyard_start.sh:

#!/bin/bash

PREFIX=shipyard

restart_rethinkdb() {
    docker $1 $PREFIX-rethinkdb
}

restart_discovery() {
    docker $1 $PREFIX-discovery
}

restart_certs() {
    docker $1 $PREFIX-certs
}

restart_proxy() {
    docker $1 $PREFIX-proxy
}

restart_swarm_manager() {
    docker $1 $PREFIX-swarm-manager
}

restart_swarm_agent() {
    docker $1 $PREFIX-swarm-agent
}

restart_controller() {
    docker $1 $PREFIX-controller
}

if [ $# -ne 1 ];
then
        echo "Usage:sh shipyard.sh  {start|stop|restart}"
        exit 1
fi
echo "Restarting Shipyard Begin."
echo "-> ${1}ing Database"
restart_rethinkdb $1
echo "-> ${1}ing Discovery"
restart_discovery $1
echo "-> ${1}ing Cert Volume"
restart_certs $1
echo "-> ${1}ing Proxy"
restart_proxy $1
echo "-> ${1}ing Swarm Manager"
restart_swarm_manager $1
echo "-> ${1}ing Swarm Agent"
restart_swarm_agent $1
echo "-> ${1}ing Controller"
restart_controller $1
echo "${1}ing Shipyard Done."

3、重启

sh  shipyard_start.sh start





你可能感兴趣的:(Docker)