fix: properly retrieve ports list
This commit is contained in:
committed by
Michael Hobbs
parent
006eb452f1
commit
7fd32fb3e8
@@ -596,17 +596,19 @@ dokku_deploy_cmd() {
|
||||
ports="$(plugn trigger network-compute-ports "$APP" "$PROC_TYPE" "$DOKKU_HEROKUISH")"
|
||||
local DOKKU_DOCKER_PORT_ARGS=""
|
||||
local DOKKU_PORT=""
|
||||
for port in "${ports[@]}"; do
|
||||
DOKKU_DOCKER_PORT_ARGS+=" -p $port "
|
||||
PORTS="$port"
|
||||
for p in "${ports[@]}"; do
|
||||
if [[ ! "$p" =~ .*udp.* ]]; then
|
||||
DOKKU_PORT=${DOKKU_PORT:="$p"}
|
||||
fi
|
||||
DOKKU_DOCKER_PORT_ARGS+=" -p $p "
|
||||
done
|
||||
|
||||
if [[ "$DOKKU_IS_APP_PROXY_ENABLED" == "true" ]]; then
|
||||
# shellcheck disable=SC2086
|
||||
local id=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d -e PORT=$port $DOCKER_ARGS $IMAGE $START_CMD)
|
||||
local id=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d -e PORT=$DOKKU_PORT $DOCKER_ARGS $IMAGE $START_CMD)
|
||||
else
|
||||
# shellcheck disable=SC2086
|
||||
local id=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d $DOKKU_DOCKER_PORT_ARGS -e PORT=$port $DOCKER_ARGS $IMAGE $START_CMD)
|
||||
local id=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d $DOKKU_DOCKER_PORT_ARGS -e PORT=$DOKKU_PORT $DOCKER_ARGS $IMAGE $START_CMD)
|
||||
fi
|
||||
else
|
||||
# shellcheck disable=SC2086
|
||||
|
||||
@@ -68,10 +68,9 @@ network-compute-container-ports() {
|
||||
for p in ${DOKKU_DOCKERFILE_PORTS[*]};do
|
||||
if [[ ! "$p" =~ .*udp.* ]]; then
|
||||
# set port to first non-udp port
|
||||
local p=${p//\/tcp}
|
||||
local PORT=${PORT:="$p"}
|
||||
p=${p//\/tcp}
|
||||
fi
|
||||
PORTS+=" $PORT "
|
||||
PORTS+="$p "
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user