jupyterhub-deploy-docker/examples/custom-notebook-server/docker-entrypoint.sh
Justin Tyberg 73163c76b9 Initial version.
(c) Copyright IBM Corp. 2016
2016-04-14 15:17:14 -04:00

21 lines
748 B
Bash
Executable File

#!/bin/bash
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
set -e
# If the run command is the default, do some initialization first
if [ "$(which "$1")" = "/usr/local/bin/start-singleuser.sh" ]; then
# Clone sample notebooks to user's notebook directory. Assume $NB_USER's work
# directory if notebook directory not explicitly set. `git clone` will fail
# if target directory already exists and is not empty, which likely means
# that we've already done it, so just ignore.
: ${NOTEBOOK_DIR:=/home/$NB_USER/work}
git clone https://gist.github.com/parente/facb555dfbae28e817e0 \
--depth 1 \
"$NOTEBOOK_DIR/notebook_count" || true
fi
# Run the command provided
exec "$@"