Merge pull request #355 from msabramo/run_docker-configurable

Allow configuring run_docker ports using env vars
This commit is contained in:
Michael Droettboom 2019-03-21 12:15:24 -04:00 committed by GitHub
commit f1b2d3bf39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 3 deletions

View File

@ -1,5 +1,13 @@
#!/bin/sh
DOCKER_PORT=8000
SYSTEM_PORT=8000
docker run -p $SYSTEM_PORT:$DOCKER_PORT --rm -v $PWD:/src --user root -e NB_UID=$UID -e NB_GID=$GID -it iodide/pyodide-env:0.3.1 /bin/bash
PYODIDE_DOCKER_PORT=${PYODIDE_DOCKER_PORT:-"8000"}
PYODIDE_SYSTEM_PORT=${PYODIDE_SYSTEM_PORT:-"8000"}
PYODIDE_DOCKER_IMAGE=${PYODIDE_DOCKER_IMAGE:-"iodide/pyodide-env:0.3.1"}
exec docker run \
-p $PYODIDE_SYSTEM_PORT:$PYODIDE_DOCKER_PORT \
-it --rm \
-v $PWD:/src \
--user root -e NB_UID=$UID -e NB_GID=$GID \
${PYODIDE_DOCKER_IMAGE} \
/bin/bash