kopia lustrzana https://github.com/jupyterhub/repo2docker
commit
e218a329f5
|
@ -356,6 +356,7 @@ class BuildPack:
|
|||
You can use environment variable substitutions in both the
|
||||
username and the execution script.
|
||||
"""
|
||||
|
||||
return []
|
||||
|
||||
def get_assemble_scripts(self):
|
||||
|
@ -520,9 +521,35 @@ class BaseImage(BuildPack):
|
|||
def get_build_env(self):
|
||||
"""Return env directives required for build"""
|
||||
return [
|
||||
("APP_BASE", "/srv")
|
||||
("APP_BASE", "/srv"),
|
||||
('NPM_DIR', '${APP_BASE}/npm'),
|
||||
('NPM_CONFIG_GLOBALCONFIG','${NPM_DIR}/npmrc')
|
||||
]
|
||||
|
||||
def get_path(self):
|
||||
return super().get_path() + [
|
||||
'${NPM_DIR}/bin'
|
||||
]
|
||||
|
||||
def get_build_scripts(self):
|
||||
scripts = [
|
||||
(
|
||||
"root",
|
||||
r"""
|
||||
mkdir -p ${NPM_DIR} && \
|
||||
chown -R ${NB_USER}:${NB_USER} ${NPM_DIR}
|
||||
"""
|
||||
),
|
||||
(
|
||||
"${NB_USER}",
|
||||
r"""
|
||||
npm config --global set prefix ${NPM_DIR}
|
||||
"""
|
||||
),
|
||||
]
|
||||
|
||||
return super().get_build_scripts() + scripts
|
||||
|
||||
def get_env(self):
|
||||
"""Return env directives to be set after build"""
|
||||
env = []
|
||||
|
@ -541,7 +568,6 @@ class BaseImage(BuildPack):
|
|||
])
|
||||
return env
|
||||
|
||||
|
||||
def detect(self):
|
||||
return True
|
||||
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
#!/bin/bash
|
||||
jupyter nbextension enable --py --sys-prefix ipyleaflet
|
||||
npm install --global configurable-http-proxy
|
|
@ -1,3 +1,4 @@
|
|||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
jupyter nbextension list | grep 'jupyter-leaflet' | grep enabled
|
||||
which configurable-http-proxy
|
||||
|
|
Ładowanie…
Reference in New Issue