mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-12 20:42:57 +00:00
Make subimages compatible with late user creation
* Always remain as root during install * Put kernel specs in system path, not user home * Create user work directory at startup * Note this is in 4.0 and up images, not 3.2 Contribution (c) Copyright IBM Corp. 2015
This commit is contained in:
@@ -3,8 +3,6 @@ FROM jupyter/minimal-notebook
|
||||
|
||||
MAINTAINER Jupyter Project <jupyter@googlegroups.com>
|
||||
|
||||
USER root
|
||||
|
||||
# Spark dependencies
|
||||
ENV APACHE_SPARK_VERSION 1.4.1
|
||||
RUN apt-get -y update && \
|
||||
@@ -43,8 +41,6 @@ RUN cd /tmp && \
|
||||
apt-get remove -y sbt && \
|
||||
apt-get clean
|
||||
|
||||
USER jovyan
|
||||
|
||||
# Spark and Mesos pointers
|
||||
ENV SPARK_HOME /usr/local/spark
|
||||
ENV R_LIBS_USER $SPARK_HOME/R/lib
|
||||
@@ -74,7 +70,7 @@ RUN conda create -p $CONDA_DIR/envs/python2 python=2.7 \
|
||||
&& conda clean -yt
|
||||
RUN $CONDA_DIR/envs/python2/bin/python \
|
||||
$CONDA_DIR/envs/python2/bin/ipython \
|
||||
kernelspec install-self --user
|
||||
kernelspec install-self
|
||||
|
||||
# R packages
|
||||
RUN conda config --add channels r
|
||||
@@ -85,9 +81,5 @@ RUN conda install --yes \
|
||||
'r-rcurl=1.95*' && conda clean -yt
|
||||
|
||||
# Scala Spark kernel spec
|
||||
RUN mkdir -p $HOME/.ipython/kernels/scala
|
||||
COPY kernel.json $HOME/.ipython/kernels/scala/
|
||||
|
||||
# Switch back to root so that supervisord runs under that user
|
||||
USER root
|
||||
RUN chown -R $NB_USER:$NB_USER $HOME/.ipython/kernels/scala/
|
||||
RUN mkdir -p /usr/local/share/jupyter/kernels/scala
|
||||
COPY kernel.json /usr/local/share/jupyter/kernels/scala/
|
||||
|
@@ -203,6 +203,7 @@ You may customize the execution of the Docker container and the Notebook server
|
||||
|
||||
* `-e PASSWORD="YOURPASS"` - Configures Jupyter Notebook to require the given password. Should be conbined with `USE_HTTPS` on untrusted networks.
|
||||
* `-e USE_HTTPS=yes` - Configures Jupyter Notebook to accept encrypted HTTPS connections. If a `pem` file containing a SSL certificate and key is not found in `/home/jovyan/.ipython/profile_default/security/notebook.pem`, the container will generate a self-signed certificate for you.
|
||||
* **(v4.0.x)** `-e NB_UID=1000` - Specify the uid of the `jovyan` user. Useful to mount host volumes with specific file ownership.
|
||||
* `-e GRANT_SUDO=yes` - Gives the `jovyan` user passwordless `sudo` capability. Useful for installing OS packages. **You should only enable `sudo` if you trust the user or if the container is running on an isolated host.**
|
||||
* `-v /some/host/folder/for/work:/home/jovyan/work` - Host mounts the default working directory on the host to preserve work even when the container is destroyed and recreated (e.g., during an upgrade).
|
||||
* **(v3.2.x)** `-v /some/host/folder/for/server.pem:/home/jovyan/.ipython/profile_default/security/notebook.pem` - Mounts a SSL certificate plus key for `USE_HTTPS`. Useful if you have a real certificate for the domain under which you are running the Notebook server.
|
||||
|
Reference in New Issue
Block a user