Skip to content

Commit 6e143df

Browse files
calbachrtitle
authored andcommitted
Update run-jupyter-local.sh post templating changes (#665)
* Update run-jupyter-local.sh post templating changes * fix paths
1 parent e838c9f commit 6e143df

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

docker/jupyter/run-jupyter-local.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
22
#
33
# To rebuild the docker image, run:
4-
# docker build jupyter-docker/ -t broadinstitute/leonardo-notebooks:local
4+
# docker build docker/jupyter/ -t broadinstitute/leonardo-jupyter:local
55
set -e
66

7-
DOCKER_IMG=broadinstitute/leonardo-notebooks:local
7+
DOCKER_IMG=broadinstitute/leonardo-jupyter:local
88
CONTAINER=jupyter-server
99

1010
start () {
@@ -17,9 +17,17 @@ start () {
1717

1818
echo "Starting Jupyter server container..."
1919
docker create -it --rm --name ${CONTAINER} -p 8000:8000 -e GOOGLE_PROJECT=project -e CLUSTER_NAME=cluster "${DOCKER_IMG}"
20-
docker cp jupyter-docker/jupyter_notebook_config.py ${CONTAINER}:/etc/jupyter/jupyter_notebook_config.py
21-
docker cp jupyter-docker/jupyter_localize_extension.py ${CONTAINER}:/etc/jupyter/custom/jupyter_localize_extension.py
22-
docker cp jupyter-docker/jupyter_delocalize.py ${CONTAINER}:/etc/jupyter/custom/jupyter_delocalize.py
20+
21+
# Substitute templated vars in the notebook config.
22+
local tmp_config=$(mktemp notebook_config.XXXX)
23+
cp src/main/resources/jupyter/jupyter_notebook_config.py ${tmp_config}
24+
sed -i '' 's/$(contentSecurityPolicy)/""/' ${tmp_config}
25+
chmod a+rw ${tmp_config}
26+
docker cp ${tmp_config} ${CONTAINER}:/etc/jupyter/jupyter_notebook_config.py
27+
rm ${tmp_config}
28+
29+
docker cp docker/jupyter/custom/jupyter_localize_extension.py ${CONTAINER}:/etc/jupyter/custom/jupyter_localize_extension.py
30+
docker cp docker/jupyter/custom/jupyter_delocalize.py ${CONTAINER}:/etc/jupyter/custom/jupyter_delocalize.py
2331
# To debug startup failures, add -a here to attach.
2432
docker start -a ${CONTAINER}
2533

0 commit comments

Comments
 (0)