Skip to content
Snippets Groups Projects
Commit 6726a61a authored by Jan David Mol's avatar Jan David Mol
Browse files

Allow jupyter notebook to start with a configurable UID (defaults to build user)

parent 5779e4a1
No related branches found
No related tags found
1 merge request!6Resolve #2012 "03 29 run containers as user"
...@@ -82,7 +82,7 @@ endif ...@@ -82,7 +82,7 @@ endif
DOCKER_COMPOSE_ARGS := DISPLAY=$(DISPLAY) XAUTHORITY=$(XAUTHORITY) TANGO_HOST=$(TANGO_HOST) \ DOCKER_COMPOSE_ARGS := DISPLAY=$(DISPLAY) XAUTHORITY=$(XAUTHORITY) TANGO_HOST=$(TANGO_HOST) \
NETWORK_MODE=$(NETWORK_MODE) XAUTHORITY_MOUNT=$(XAUTHORITY_MOUNT) TANGO_SKA_CONTAINER_MOUNT=$(TANGO_SKA_CONTAINER_MOUNT) TANGO_LOFAR_CONTAINER_MOUNT=$(TANGO_LOFAR_CONTAINER_MOUNT) TANGO_LOFAR_CONTAINER_DIR=${TANGO_LOFAR_CONTAINER_DIR} MYSQL_HOST=$(MYSQL_HOST) \ NETWORK_MODE=$(NETWORK_MODE) XAUTHORITY_MOUNT=$(XAUTHORITY_MOUNT) TANGO_SKA_CONTAINER_MOUNT=$(TANGO_SKA_CONTAINER_MOUNT) TANGO_LOFAR_CONTAINER_MOUNT=$(TANGO_LOFAR_CONTAINER_MOUNT) TANGO_LOFAR_CONTAINER_DIR=${TANGO_LOFAR_CONTAINER_DIR} MYSQL_HOST=$(MYSQL_HOST) \
CONTAINER_NAME_PREFIX=$(CONTAINER_NAME_PREFIX) COMPOSE_IGNORE_ORPHANS=true CONTAINER_NAME_PREFIX=$(CONTAINER_NAME_PREFIX) COMPOSE_IGNORE_ORPHANS=true LOFAR_UID=$(shell id -u)
.PHONY: up down minimal start stop status clean pull help .PHONY: up down minimal start stop status clean pull help
......
...@@ -26,6 +26,7 @@ services: ...@@ -26,6 +26,7 @@ services:
- DISPLAY=${DISPLAY} - DISPLAY=${DISPLAY}
ports: ports:
- "8888:8888" - "8888:8888"
user: ${LOFAR_UID}
working_dir: /jupyter-notebooks working_dir: /jupyter-notebooks
entrypoint: entrypoint:
- /usr/local/bin/wait-for-it.sh - /usr/local/bin/wait-for-it.sh
......
ARG VERSION=latest ARG VERSION=latest
FROM nexus.engageska-portugal.pt/ska-docker/tango-itango:${VERSION} FROM nexus.engageska-portugal.pt/ska-docker/tango-itango:${VERSION}
RUN pip3 install jupyter RUN sudo pip3 install jupyter
RUN pip3 install ipykernel RUN sudo pip3 install ipykernel
RUN pip3 install jupyter_bokeh RUN sudo pip3 install jupyter_bokeh
# Configure jupyter_bokeh # Configure jupyter_bokeh
RUN sudo mkdir -p /usr/share/jupyter /usr/etc RUN sudo mkdir -p /usr/share/jupyter /usr/etc
RUN sudo chmod a+rwx /usr/share/jupyter /usr/etc RUN sudo chmod a+rwx /usr/share/jupyter /usr/etc
RUN jupyter nbextension install --sys-prefix --symlink --py jupyter_bokeh RUN sudo jupyter nbextension install --sys-prefix --symlink --py jupyter_bokeh
RUN jupyter nbextension enable jupyter_bokeh --py --sys-prefix RUN sudo jupyter nbextension enable jupyter_bokeh --py --sys-prefix
# Install profiles for ipython & jupyter # Install profiles for ipython & jupyter
COPY ipython-profiles /opt/ipython-profiles/ COPY ipython-profiles /opt/ipython-profiles/
...@@ -18,5 +18,6 @@ COPY jupyter-kernels /usr/local/share/jupyter/kernels/ ...@@ -18,5 +18,6 @@ COPY jupyter-kernels /usr/local/share/jupyter/kernels/
# Add Tini. Tini operates as a process subreaper for jupyter. This prevents kernel crashes. # Add Tini. Tini operates as a process subreaper for jupyter. This prevents kernel crashes.
ENV TINI_VERSION v0.6.0 ENV TINI_VERSION v0.6.0
ENV JUPYTER_RUNTIME_DIR=/tmp
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini
RUN sudo chmod +x /usr/bin/tini RUN sudo chmod +x /usr/bin/tini
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment