Skip to content

Commit 0d4b152

Browse files
colorimetermagwas
authored andcommitted
Do not map port 5900 if already mapped by other container (#300)
1 parent 8a05c1e commit 0d4b152

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tools/testenv

+9-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@ DEVHOME=${DEVHOME:-~/pdengine-developer-home/}
44
DEV_UID=$(id -u)
55
DEV_GID=$(id -g)
66
PDENGINE_IMAGE=${PDENGINE_IMAGE:-edemo/pdengine}
7-
docker run --rm -p 5900:5900 -e PULL_REQUEST=false -e DEVUID=${DEV_UID} -e DEVGID=${DEV_GID} -e ORG_NAME=local \
7+
VNCPORT=5900
8+
PORTMAP="-p $VNCPORT:$VNCPORT"
9+
if docker ps | grep -q ":$VNCPORT-"
10+
then
11+
# port already taken by other container
12+
PORTMAP=""
13+
fi
14+
15+
docker run --rm $PORTMAP -e PULL_REQUEST=false -e DEVUID=${DEV_UID} -e DEVGID=${DEV_GID} -e ORG_NAME=local \
816
-v $(pwd):/pdengine -v ${DEVHOME}:/home/developer -v /tmp/.X11-unix:/tmp/.X11-unix \
917
-w /pdengine -it ${PDENGINE_IMAGE}
1018

0 commit comments

Comments
 (0)