# HG changeset patch # User Goffi # Date 1456341845 -3600 # Node ID 33f9610480ea46db6f26f8cceda63046059afcc3 # Parent eeff161a19e88d74f0b8c1bfa68beb88492d173e docker (libervia_cont): SAT_CONT_PORT_ environment variable can now be used to specify destination ports when -p is used diff -r eeff161a19e8 -r 33f9610480ea docker/libervia_cont.sh --- a/docker/libervia_cont.sh Wed Feb 24 20:21:34 2016 +0100 +++ b/docker/libervia_cont.sh Wed Feb 24 20:24:05 2016 +0100 @@ -24,6 +24,7 @@ # SAT_CONT_DOMAIN for the host name # SAT_CONT_BACKUP_DIR is the directory where tar.gz backup will be written # SAT_CONT_DK_EXTRA is used for extra options (used with all containers but sat_data) +# SAT_CONT_PORT_ is used to specify port when -p is used, must be an exposed port CONTAINERS="prosody sat_pubsub salut sat libervia" @@ -114,7 +115,13 @@ ports=$(get_dyn_var $cont ports) ARG="" for port in $ports; do - ARG="$ARG -p $port:$port" + host_port=$(eval echo "\$SAT_CONT_PORT_${port}") + if [ -z "$host_port" ]; then + host_port=$port + fi + if [ "$host_port" != 0 ]; then + ARG="$ARG -p $host_port:$port" + fi done echo $ARG } @@ -256,7 +263,7 @@ done printf '\nLibervia is launched and should be reachable in a couple of seconds.\nYou can check logs with "docker logs -f libervia" (or any other container name).\n' printf "An \"admin\" account has been created, you can check its password on $VOLUME_ALIAS container, in file /home/sat/ADMIN_PWD. Config can be tuned on this container.\n" - printf 'Below are the ports used to connect, you can go with your browser to Libervia HTTP port.\n\n' + printf 'Below are the ports used to connect, you can go with your browser to Libervia HTTP(S) port.\n\n' list_ports ;; STOP)