Fixed broken ordering of steps when PORT is specified.
This commit is contained in:
3
receiver
3
receiver
@@ -12,10 +12,9 @@ if [[ -f "$HOME/$1/PORT" ]]; then
|
|||||||
OLDID=$(< "$HOME/$1/CONTAINER")
|
OLDID=$(< "$HOME/$1/CONTAINER")
|
||||||
docker kill $OLDID > /dev/null
|
docker kill $OLDID > /dev/null
|
||||||
PORT=$(< "$HOME/$1/PORT")
|
PORT=$(< "$HOME/$1/PORT")
|
||||||
echo $ID > "$HOME/$1/CONTAINER"
|
|
||||||
ID=$(docker run -d -p ":$PORT" -e "PORT=$PORT" $APP /bin/bash -c "if [ -d /app/.profile.d ]; then source /app/.profile.d/*; fi; cd /app && ./start")
|
ID=$(docker run -d -p ":$PORT" -e "PORT=$PORT" $APP /bin/bash -c "if [ -d /app/.profile.d ]; then source /app/.profile.d/*; fi; cd /app && ./start")
|
||||||
|
echo $ID > "$HOME/$1/CONTAINER"
|
||||||
else
|
else
|
||||||
|
|
||||||
ID=$(docker run -d -p 5000 -e PORT=5000 $APP /bin/bash -c "if [ -d /app/.profile.d ]; then source /app/.profile.d/*; fi; cd /app && ./start")
|
ID=$(docker run -d -p 5000 -e PORT=5000 $APP /bin/bash -c "if [ -d /app/.profile.d ]; then source /app/.profile.d/*; fi; cd /app && ./start")
|
||||||
echo $ID > "$HOME/$1/CONTAINER"
|
echo $ID > "$HOME/$1/CONTAINER"
|
||||||
PORT=$(docker inspect $ID | ruby -e 'require"json";puts JSON.parse(STDIN.read)["NetworkSettings"]["PortMapping"]["5000"]')
|
PORT=$(docker inspect $ID | ruby -e 'require"json";puts JSON.parse(STDIN.read)["NetworkSettings"]["PortMapping"]["5000"]')
|
||||||
|
|||||||
Reference in New Issue
Block a user