diff --git a/minimal-kernel/Dockerfile b/minimal-kernel/Dockerfile index f429dd57..53ccf00f 100644 --- a/minimal-kernel/Dockerfile +++ b/minimal-kernel/Dockerfile @@ -8,16 +8,15 @@ USER root # Install all OS dependencies for fully functional notebook server ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get install -yq --no-install-recommends \ - git \ - vim \ wget \ build-essential \ - python-dev \ + python3-dev \ + python3-pip \ ca-certificates \ bzip2 \ unzip \ libsm6 \ - pandoc \ + python3-zmq \ sudo \ && apt-get clean @@ -28,45 +27,30 @@ RUN wget --quiet https://github.com/krallin/tini/releases/download/v0.6.0/tini & chmod +x /usr/local/bin/tini # Configure environment -ENV CONDA_DIR /opt/conda -ENV PATH $CONDA_DIR/bin:$PATH ENV SHELL /bin/bash ENV NB_USER jovyan ENV NB_UID 1000 -# Install conda -RUN mkdir -p $CONDA_DIR && \ - echo export PATH=$CONDA_DIR/bin:'$PATH' > /etc/profile.d/conda.sh && \ - wget --quiet https://repo.continuum.io/miniconda/Miniconda3-3.9.1-Linux-x86_64.sh && \ - echo "6c6b44acdd0bc4229377ee10d52c8ac6160c336d9cdd669db7371aa9344e1ac3 *Miniconda3-3.9.1-Linux-x86_64.sh" | sha256sum -c - && \ - /bin/bash /Miniconda3-3.9.1-Linux-x86_64.sh -f -b -p $CONDA_DIR && \ - rm Miniconda3-3.9.1-Linux-x86_64.sh && \ - $CONDA_DIR/bin/conda install --yes conda==3.14.1 - # Create jovyan user with UID=1000 and in the 'users' group -# Grant ownership over the conda dir and home dir, but stick the group as root. +# Grant ownership over the home dir, but stick the group as root. RUN useradd -m -s /bin/bash -N -u $NB_UID $NB_USER && \ mkdir /home/$NB_USER/work && \ mkdir /home/$NB_USER/.jupyter && \ mkdir /home/$NB_USER/.local && \ - chown -R $NB_USER:users $CONDA_DIR && \ chown -R $NB_USER:users /home/$NB_USER # Install Kernel Gateway -RUN cd /tmp && \ - git clone https://github.com/jupyter-incubator/kernel_gateway.git && \ - cd kernel_gateway && \ - python setup.py sdist && \ - pip install dist/jupyter_kernel_gateway-*.tar.gz && \ - rm -rf /tmp/kernel_gateway +RUN pip3 install jupyter_kernel_gateway==0.2.0 # Configure container startup +USER $NB_USER EXPOSE 8888 WORKDIR /home/$NB_USER/work ENTRYPOINT ["tini", "--"] -CMD ["start.sh"] +CMD ["/usr/local/bin/start-notebook.sh"] # Add local files as late as possible to avoid cache busting -COPY start.sh /usr/local/bin/ +USER root +COPY start-notebook.sh /usr/local/bin/ COPY jupyter_kernel_gateway_config.py /home/$NB_USER/.jupyter/ RUN chown -R $NB_USER:users /home/$NB_USER/.jupyter diff --git a/minimal-kernel/README.md b/minimal-kernel/README.md index 45f5d938..924f24e2 100644 --- a/minimal-kernel/README.md +++ b/minimal-kernel/README.md @@ -2,9 +2,8 @@ ## What it Gives You * [Jupyter Kernel Gateway](https://github.com/jupyter-incubator/kernel_gateway) that spawns minimal Jupyter Python kernel -* Conda Python 3.4.x * No preinstalled scientific computing packages -* Unprivileged user `jovyan` (uid=1000, configurable, see options) in group `users` (gid=100) with ownership over `/home/jovyan` and `/opt/conda` +* Unprivileged user `jovyan` (uid=1000, configurable, see options) in group `users` (gid=100) with ownership over `/home/jovyan` * [tini](https://github.com/krallin/tini) as the container entrypoint and [start.sh](./start.sh) as the default command * Options for Port and Ip address @@ -22,8 +21,4 @@ docker run -d -p 8888:8888 jupyter/minimal-kernel You may customize the execution of the Docker container and the Notebook server it contains with the following optional arguments. * `-e INTERFACE=10.10.10.10` - Configures Kernel Gateway to listen on the given interface. Defaults to '0.0.0.0', all interfaces, which is appropriate when running using default bridged Docker networking. When using Docker's `--net=host`, you may wish to use this option to specify a particular network interface. -* `-e PORT=8888` - Configures Kernel Gateway to listen on the given port. Defaults to 8888, which is the port exposed within the Dockerfile for the image. When using Docker's `--net=host`, you may wish to use this option to specify a particular port. - -## Conda Environment - -The default Python 3.x [Conda environment](http://conda.pydata.org/docs/using/envs.html) resides in `/opt/conda`. The commands `ipython`, `python`, `pip`, `easy_install`, and `conda` (among others) are available in this environment. +* `-e PORT=8888` - Configures Kernel Gateway to listen on the given port. Defaults to 8888, which is the port exposed within the Dockerfile for the image. When using Docker's `--net=host`, you may wish to use this option to specify a particular port. \ No newline at end of file diff --git a/minimal-kernel/start.sh b/minimal-kernel/start-notebook.sh old mode 100755 new mode 100644 similarity index 92% rename from minimal-kernel/start.sh rename to minimal-kernel/start-notebook.sh index cb353135..25635072 --- a/minimal-kernel/start.sh +++ b/minimal-kernel/start-notebook.sh @@ -3,7 +3,6 @@ # Change UID of NB_USER to NB_UID if it does not match if [ "$NB_UID" != $(id -u $NB_USER) ] ; then usermod -u $NB_UID $NB_USER - chown -R $NB_UID $CONDA_DIR fi # Enable sudo if requested