Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save limbuu/b38574419c86f4046ea705c9ca647694 to your computer and use it in GitHub Desktop.
Save limbuu/b38574419c86f4046ea705c9ca647694 to your computer and use it in GitHub Desktop.
# 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
@limbuu
Copy link
Author

limbuu commented Mar 10, 2021

For any user other tha root, use following:

username=jovyan
password=jovyan

adduser --gecos "" --disabled-password $username
chpasswd <<<"$username:$password"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment