Skip to content

Commit

Permalink
refactor dockerfile
Browse files Browse the repository at this point in the history
Signed-off-by: Greg Werner <[email protected]>
  • Loading branch information
jgwerner committed Mar 27, 2024
1 parent e5b9483 commit 240a233
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions umich-notebook/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Based mostly off of https://github.com/jupyter/docker-stacks/datascience-notebook image
ARG TAG=julia-1.9.3
ARG BASE_IMAGE=jupyter/datascience-notebook
FROM $BASE_IMAGE:$TAG
# Based mostly off of:
# https://github.com/jupyter/docker-stacks/blob/main/images/julia-notebook
ARG REGISTRY=quay.io
ARG OWNER=jupyter
ARG BASE_CONTAINER=$REGISTRY/$OWNER/minimal-notebook
FROM $BASE_CONTAINER

ENV NB_UID=1000
ENV NB_GID=100
# Fix: https://github.com/hadolint/hadolint/wiki/DL4006
# Fix: https://github.com/koalaman/shellcheck/wiki/SC3014
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

USER root

Expand All @@ -14,24 +17,15 @@ ENV JULIA_DEPOT_PATH=/opt/julia \
JULIA_PKGDIR=/opt/julia

# Setup Julia
COPY setup-scripts/setup_julia.py /opt/setup-scripts/setup_julia.py
RUN chmod +rx /opt/setup-scripts/setup_julia.py
RUN /opt/setup-scripts/setup_julia.py

USER "${NB_UID}"
USER ${NB_UID}

# Install julia packages
COPY --chown="${NB_UID}":"${NB_GID}" setup-scripts/install-julia-packages.bash /opt/setup-scripts/install-julia-packages.bash

RUN chmod +rx /opt/setup-scripts/install-julia-packages.bash
RUN fix-permissions "${JULIA_PKGDIR}" \
&& fix-permissions "${HOME}"
# Setup IJulia kernel & other packages
RUN /opt/setup-scripts/setup-julia-packages.bash

RUN pip install jupyter_kernel_gateway psycopg2-binary

# Setup Julia
RUN /opt/setup-scripts/install-julia-packages.bash

WORKDIR "${HOME}"

CMD ["jupyter", "kernelgateway", "--KernelGatewayApp.ip=0.0.0.0", "--KernelGatewayApp.port=8888"]

0 comments on commit 240a233

Please sign in to comment.