comparison docker/libervia_cont.sh @ 93:70f65a6b3392

docker (libervia_cont): added SAT_CONT_DK_EXTRA environment variable for specifying extra options when running containers
author Goffi <goffi@goffi.org>
date Wed, 24 Feb 2016 15:42:48 +0100
parents 5a0ed7f94ab8
children 33f9610480ea
comparison
equal deleted inserted replaced
92:5a0ed7f94ab8 93:70f65a6b3392
21 21
22 # environment variables that can be used for configuration: 22 # environment variables that can be used for configuration:
23 # SAT_CONT_TLS_DIR for TLS certificates directory 23 # SAT_CONT_TLS_DIR for TLS certificates directory
24 # SAT_CONT_DOMAIN for the host name 24 # SAT_CONT_DOMAIN for the host name
25 # SAT_CONT_BACKUP_DIR is the directory where tar.gz backup will be written 25 # SAT_CONT_BACKUP_DIR is the directory where tar.gz backup will be written
26 # SAT_CONT_DK_EXTRA is used for extra options (used with all containers but sat_data)
26 27
27 CONTAINERS="prosody sat_pubsub salut sat libervia" 28 CONTAINERS="prosody sat_pubsub salut sat libervia"
28 29
29 DK_DETACH="-d" 30 DK_DETACH="-d"
30 DK_TERM="-ti" 31 DK_TERM="-ti"
242 sat) OPTS="$DK_DETACH $DK_TERM $DK_VOLUME -P $(public_ports_arg $CONT) --name sat --link=prosody:prosody";; 243 sat) OPTS="$DK_DETACH $DK_TERM $DK_VOLUME -P $(public_ports_arg $CONT) --name sat --link=prosody:prosody";;
243 libervia) OPTS="$DK_DETACH $DK_TERM $DK_VOLUME --volumes-from sat $DK_TLS -P $(public_ports_arg $CONT) --name libervia --link=sat:sat";; 244 libervia) OPTS="$DK_DETACH $DK_TERM $DK_VOLUME --volumes-from sat $DK_TLS -P $(public_ports_arg $CONT) --name libervia --link=sat:sat";;
244 *) printf "Unkown container $CONT\n"; exit 1 245 *) printf "Unkown container $CONT\n"; exit 1
245 esac 246 esac
246 printf "Launching $CONT... " 247 printf "Launching $CONT... "
247 docker_id=$(docker run $OPTS $ACCOUNT/$CONT 2>&1) 248 docker_id=$(docker run $OPTS $SAT_CONT_DK_EXTRA $ACCOUNT/$CONT 2>&1)
248 if [ $? -eq 0 ]; then 249 if [ $? -eq 0 ]; then
249 printf "OK ($docker_id)\n" 250 printf "OK ($docker_id)\n"
250 else 251 else
251 printf "Error, please check container or ask help on XMPP MUC sat@chat.jabberfr.org\nerror message: $docker_id\n" 252 printf "Error, please check container or ask help on XMPP MUC sat@chat.jabberfr.org\nerror message: $docker_id\n"
252 printf "Abandon\n" 253 printf "Abandon\n"