Skip to content

Instantly share code, notes, and snippets.

@RichardBronosky
Created January 11, 2021 22:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save RichardBronosky/ced860afca56f03a441faf732651e6bf to your computer and use it in GitHub Desktop.
Save RichardBronosky/ced860afca56f03a441faf732651e6bf to your computer and use it in GitHub Desktop.
Jupyter notebook with bash kernel and ability to `su -` to install software
# https://docs.docker.com/engine/reference/builder/
# /home/jovyan/work
ARG BASE_CONTAINER=jupyter/minimal-notebook
FROM $BASE_CONTAINER
LABEL maintainer="Bruno Bronosky <bruno@bronosky.com>"
USER root
# Install all OS dependencies for fully functional notebook server
RUN pip install bash_kernel && python -m bash_kernel.install
# Allow using 'su -' to make sandbox changes
RUN chpasswd <<<"root:root" && \
sed -Ei 's/(.*pam_deny.so)/# \1/' /etc/pam.d/su
# Switch back to jovyan to avoid accidental container runs as root
USER $NB_UID
EXPOSE 8888
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment