diff --git a/docker_devbox/hub.Dockerfile b/docker_devbox/hub.Dockerfile index 5f77bd0..0319e9a 100644 --- a/docker_devbox/hub.Dockerfile +++ b/docker_devbox/hub.Dockerfile @@ -14,11 +14,10 @@ ARG ARG_KEEP_NODEJS=true COPY work /opt/utils/ RUN set -eux \ - && chmod +x /opt/utils/*.sh \ + && chmod +x /opt/utils/*.sh && rm -rf /opt/utils/etc_jupyter \ # Setup JupyterHub && source /opt/utils/script-devbox-jupyter.sh \ - && mv /opt/utils/start-*.sh /usr/local/bin/ && chmod +x /usr/local/bin/start-*.sh \ - && for profile in $(echo $ARG_PROFILE_JUPYTER | tr "," "\n") ; do ( setup_jupyter_${profile} || true ) ; done \ + && for profile in $(echo $ARG_PROFILE_JUPYTER | tr "," "\n") ; do ( setup_jupyter_${profile} ) ; done \ # If not keeping NodeJS, remove NoedJS to reduce image size, and install Traefik instead && if [ ${ARG_KEEP_NODEJS} = "false" ] ; then \ echo "Removing Node/NPM..." && rm -rf /usr/bin/node /usr/bin/npm /usr/bin/npx /opt/node ; \ @@ -26,6 +25,12 @@ RUN set -eux \ else \ echo "Keep NodeJS as ARG_KEEP_NODEJS defiend as: ${ARG_KEEP_NODEJS}" ; \ fi \ + # network-tools https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/main/images/network-tools/Dockerfile + && apt-get update && apt-get install -y --no-install-recommends \ + iptables dnsutils libcurl4 libpq5 sqlite3 \ + && curl -fsSL -o /usr/local/bin/start-configurable-http-proxy.sh https://raw.githubusercontent.com/jupyterhub/configurable-http-proxy/refs/heads/main/chp-docker-entrypoint \ + && mv /opt/utils/start-*.sh /usr/local/bin/ \ + && chmod +x /usr/local/bin/start-*.sh \ # Clean up and display components version information... && source /opt/utils/script-utils.sh && install__clean && list_installed_packages diff --git a/docker_devbox/work/install_list_JPY_extend.pip b/docker_devbox/work/install_list_JPY_extend.pip index 2823595..22fa11b 100644 --- a/docker_devbox/work/install_list_JPY_extend.pip +++ b/docker_devbox/work/install_list_JPY_extend.pip @@ -1,14 +1,15 @@ % This file contains python packages to be installed with pip line by line. % Use percent char as line comment separator. +nbgitpuller % https://github.com/jupyterhub/nbgitpuller ipyparallel % https://github.com/ipython/ipyparallel % jupyterlab_myst % https://github.com/executablebooks/jupyterlab-myst - BUG: https://github.com/jupyter-book/jupyterlab-myst/issues/243 jupytext % https://github.com/mwouts/jupytext -ipynb % https://github.com/ipython/ipynb jupyterlab_server[openapi] % https://github.com/jupyterlab/jupyterlab_server jupyter-resource-usage % https://github.com/jupyter-server/jupyter-resource-usage -jupyterlab_rise % https://github.com/jupyterlab-contrib/rise jupyterlab-git % https://github.com/jupyterlab/jupyterlab-git -jupyterlab-language-pack-zh-CN % language pack: https://github.com/jupyterlab/language-packs/tree/main/language-packs/jupyterlab-language-pack-zh-CN +jupyterlab-language-pack-zh-CN % lang pack: https://github.com/jupyterlab/language-packs/tree/main/language-packs/jupyterlab-language-pack-zh-CN +jupyterlab-latex % https://github.com/jupyterlab/jupyterlab-latex % jupyter-collaboration % https://github.com/jupyterlab/jupyter-collaboration -% jupyterlab-latex % bug on pypi version: https://github.com/jupyterlab/jupyterlab-latex +% jupyterlab_rise % https://github.com/jupyterlab-contrib/rise +% ipynb % https://github.com/ipython/ipynb diff --git a/docker_devbox/work/script-devbox-jupyter.sh b/docker_devbox/work/script-devbox-jupyter.sh index ea386ea..acc9da5 100644 --- a/docker_devbox/work/script-devbox-jupyter.sh +++ b/docker_devbox/work/script-devbox-jupyter.sh @@ -102,13 +102,23 @@ setup_jupyter_extensions() { setup_jupyter_hub() { # ref1: https://github.com/jupyterhub/jupyterhub # ref2: https://github.com/jupyterhub/jupyterhub/blob/main/Dockerfile - which npm && ( npm install -g npm configurable-http-proxy ) || ( echo "NPM not found!" && return 255 ) - - pip install -Uq --pre jupyterhub \ - && pip install -Uq oauthenticator jupyterhub-ldapauthenticator jupyterhub-kerberosauthenticator \ - && pip install -Uq dockerspawner jupyterhub-kubespawner jupyterhub-systemdspawner wrapspawner \ - && pip install -Uq psutil pycurl jupyter_client jupyterhub \ - && pip install -Uq jupyterhub-traefik-proxy configurable-http-proxy + # ref3: https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/main/images/hub/unfrozen/requirements.txt + which npm && ( npm install -g npm configurable-http-proxy ) || ( echo "NPM not found!" && return 255 ) ; + + pip install -Uq --pre jupyterhub jupyter_client \ + dockerspawner jupyterhub-kubespawner jupyterhub-systemdspawner wrapspawner \ + jupyterhub-ldapauthenticator jupyterhub-kerberosauthenticator \ + jupyterhub-firstuseauthenticator jupyterhub-hmacauthenticator jupyterhub-ltiauthenticator \ + jupyterhub-nativeauthenticator jupyterhub-tmpauthenticator \ + oauthenticator[googlegroups,mediawiki] jupyterhub-idle-culler \ + psycopg pymysql sqlalchemy-cockroachdb \ + psutil pycurl py-spy \ + jupyterhub-traefik-proxy ; + + # Notes: there is also an python version of configurable-http-proxy available but has limited compatibility. + ln -sf $(which configurable-http-proxy) /usr/local/bin/configurable-http-proxy ; + + type configurable-http-proxy && echo "@ Configurable HTTP Proxy version: $(configurable-http-proxy --version)" || return -1 ; type jupyterhub && echo "@ JupyterHub version: $(jupyterhub --version)" || return -1 ; }