Skip to content

Commit

Permalink
Sync from debuggingbook
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-zeller committed Jun 30, 2024
1 parent 4af2d46 commit 365bc47
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
19 changes: 14 additions & 5 deletions binder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@
# Dockerfile instead.

# To test, use
# docker build -t my-image binder
# make docker-image
# and then
# make docker-run (for a jupyter notebook)
# make docker-shell (for a bash shell)

# For more infp, see
# For more info, see
# https://mybinder.readthedocs.io/en/latest/tutorials/dockerfile.html
# https://github.com/binder-examples/minimal-dockerfile

# This Dockerfile is meant to be used in the mybinder environment,
# but it can also serve as a base to deploy docker images.

# From minimal-dockerfile
# FROM python:3.10-slim
# From docker2repo
Expand All @@ -22,10 +28,10 @@ ARG REPO=https://github.com/uds-se/${PROJECT}.git

# Install git and pip
RUN apt-get update
RUN apt-get install -y git python3 pip gcc
RUN apt-get install -y git python3 pip npm gcc

# Some version info
RUN echo "This is ${PROJECT} with $(python3 --version)"
RUN echo "This is ${PROJECT} with $(python3 --version)" 1>&2

# Install jupyter
RUN pip install --no-cache --upgrade pip && \
Expand Down Expand Up @@ -54,6 +60,9 @@ WORKDIR ${PROJECT}
# Install the required Linux packages
RUN apt-get install -y $(grep -v '^#' binder/apt.txt); exit 0

# Expose port 8888, so it can be reached from the outside (for local testing)
EXPOSE 8888

# From here on, we are a user
USER ${NB_USER}

Expand All @@ -69,5 +78,5 @@ ENV PATH="/home/${NB_USER}/.local/bin:$PATH"
RUN pip install -r requirements.txt; exit 0
RUN pip install -r binder/requirements.txt; exit 0

# Run the postBuild script
# Run the postBuild script (to sign notebooks and more)
RUN bash binder/postBuild
8 changes: 8 additions & 0 deletions binder/postBuild.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/bin/bash

# Enable incompatible extensions
echo postBuild: Enabling incompatible Jupyter extensions...
NBCONFIG_PATH=$HOME/.jupyter/nbconfig
mkdir -p $NBCONFIG_PATH
echo '{
"nbext_hide_incompat": false
}' > $NBCONFIG_PATH/common.json

# Install and enable Jupyter nbextensions
# https://github.com/binder-examples/jupyter-extension
# https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/install.html
Expand Down

0 comments on commit 365bc47

Please sign in to comment.