mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-18 15:32:56 +00:00
make jupyterhub env->cli args optional
DockerSpawner will stop passing these args, so make them optional.
This commit is contained in:
@@ -4,19 +4,35 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
notebook_arg=""
|
# set default ip to 0.0.0.0
|
||||||
if [ -n "${NOTEBOOK_DIR:+x}" ]
|
if [[ "$NOTEBOOK_ARGS $@" != *"--ip="* ]]; then
|
||||||
then
|
NOTEBOOK_ARGS="--ip=0.0.0.0 $NOTEBOOK_ARGS"
|
||||||
notebook_arg="--notebook-dir=${NOTEBOOK_DIR}"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
. /usr/local/bin/start.sh jupyterhub-singleuser \
|
# handle some deprecated environment variables
|
||||||
--port=${JPY_PORT:-8888} \
|
# from DockerSpawner < 0.8.
|
||||||
--ip=0.0.0.0 \
|
# These won't be passed from DockerSpawner 0.9,
|
||||||
--user=$JPY_USER \
|
# so avoid specifying --arg=empty-string
|
||||||
--cookie-name=$JPY_COOKIE_NAME \
|
if [ ! -z "$NOTEBOOK_DIR" ]; then
|
||||||
--base-url=$JPY_BASE_URL \
|
NOTEBOOK_ARGS="--notebook-dir=$NOTEBOOK_DIR $NOTEBOOK_ARGS"
|
||||||
--hub-prefix=$JPY_HUB_PREFIX \
|
fi
|
||||||
--hub-api-url=$JPY_HUB_API_URL \
|
if [ ! -z "$JPY_PORT" ]; then
|
||||||
${notebook_arg} \
|
NOTEBOOK_ARGS="--port=$JPY_PORT $NOTEBOOK_ARGS"
|
||||||
$@
|
fi
|
||||||
|
if [ ! -z "$JPY_USER" ]; then
|
||||||
|
NOTEBOOK_ARGS="--user=$JPY_USER $NOTEBOOK_ARGS"
|
||||||
|
fi
|
||||||
|
if [ ! -z "$JPY_COOKIE_NAME" ]; then
|
||||||
|
NOTEBOOK_ARGS="--cookie-name=$JPY_COOKIE_NAME $NOTEBOOK_ARGS"
|
||||||
|
fi
|
||||||
|
if [ ! -z "$JPY_BASE_URL" ]; then
|
||||||
|
NOTEBOOK_ARGS="--base-url=$JPY_BASE_URL $NOTEBOOK_ARGS"
|
||||||
|
fi
|
||||||
|
if [ ! -z "$JPY_HUB_PREFIX" ]; then
|
||||||
|
NOTEBOOK_ARGS="--hub-prefix=$JPY_HUB_PREFIX $NOTEBOOK_ARGS"
|
||||||
|
fi
|
||||||
|
if [ ! -z "$JPY_HUB_API_URL" ]; then
|
||||||
|
NOTEBOOK_ARGS="--hub-api-url=$JPY_HUB_API_URL $NOTEBOOK_ARGS"
|
||||||
|
fi
|
||||||
|
|
||||||
|
. /usr/local/bin/start.sh jupyterhub-singleuser $NOTEBOOK_ARGS $@
|
||||||
|
Reference in New Issue
Block a user