diff --git a/all-spark-notebook/Dockerfile b/all-spark-notebook/Dockerfile index a0ccb5d8..872bdb7a 100644 --- a/all-spark-notebook/Dockerfile +++ b/all-spark-notebook/Dockerfile @@ -91,4 +91,5 @@ USER root # switching at runtime. RUN $CONDA_DIR/envs/python2/bin/python \ $CONDA_DIR/envs/python2/bin/ipython \ - kernelspec install-self \ No newline at end of file + kernelspec install-self + diff --git a/datascience-notebook/Dockerfile b/datascience-notebook/Dockerfile index f1af91c2..24fff04a 100644 --- a/datascience-notebook/Dockerfile +++ b/datascience-notebook/Dockerfile @@ -96,4 +96,5 @@ USER root # switching at runtime. RUN $CONDA_DIR/envs/python2/bin/python \ $CONDA_DIR/envs/python2/bin/ipython \ - kernelspec install-self \ No newline at end of file + kernelspec install-self + diff --git a/minimal-notebook/Dockerfile b/minimal-notebook/Dockerfile index ce94b021..c6d4ebd8 100644 --- a/minimal-notebook/Dockerfile +++ b/minimal-notebook/Dockerfile @@ -22,13 +22,19 @@ RUN apt-get update && apt-get install -yq --no-install-recommends \ texlive-latex-extra \ texlive-fonts-extra \ texlive-fonts-recommended \ - supervisor \ sudo \ && apt-get clean +# Install Tini +RUN wget --quiet https://github.com/krallin/tini/releases/download/v0.6.0/tini && \ + echo "d5ed732199c36a1189320e6c4859f0169e950692f451c03e7854243b95f4234b *tini" | sha256sum -c - && \ + mv tini /usr/local/bin/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 @@ -36,6 +42,7 @@ ENV NB_UID 1000 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 @@ -57,10 +64,11 @@ RUN useradd -m -s /bin/bash -N -u $NB_UID $NB_USER && \ # Configure container startup EXPOSE 8888 -CMD [ "start-notebook.sh" ] +WORKDIR /home/$NB_USER/work +ENTRYPOINT ["tini", "--"] +CMD ["start-notebook.sh"] # Add local files as late as possible to avoid cache busting COPY start-notebook.sh /usr/local/bin/ -COPY notebook.conf /etc/supervisor/conf.d/ COPY jupyter_notebook_config.py /home/$NB_USER/.jupyter/ RUN chown -R $NB_USER:users /home/$NB_USER/.jupyter \ No newline at end of file diff --git a/minimal-notebook/notebook.conf b/minimal-notebook/notebook.conf deleted file mode 100644 index a63b3596..00000000 --- a/minimal-notebook/notebook.conf +++ /dev/null @@ -1,10 +0,0 @@ -[program:notebook] -user=jovyan -umask=0002 -directory=/home/jovyan/work -command=ipython notebook -autostart=true -autorestart=true -stdout_logfile=/var/log/supervisor/%(program_name)s.log -redirect_stderr=true -environment=HOME="/home/jovyan",USER="jovyan",SHELL="/bin/bash" diff --git a/minimal-notebook/start-notebook.sh b/minimal-notebook/start-notebook.sh index f385ef32..c9f42972 100755 --- a/minimal-notebook/start-notebook.sh +++ b/minimal-notebook/start-notebook.sh @@ -11,5 +11,6 @@ if [ ! -z "$GRANT_SUDO" ]; then echo "$NB_USER ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/notebook fi -# Start supervisord in foreground, PID1 -exec supervisord -n -c /etc/supervisor/supervisord.conf +# Start the notebook server +exec su $NB_USER -c "env PATH=$PATH jupyter notebook $@" + diff --git a/pyspark-notebook/Dockerfile b/pyspark-notebook/Dockerfile index 646f9c49..c29dbef4 100644 --- a/pyspark-notebook/Dockerfile +++ b/pyspark-notebook/Dockerfile @@ -57,4 +57,5 @@ USER root # switching at runtime. RUN $CONDA_DIR/envs/python2/bin/python \ $CONDA_DIR/envs/python2/bin/ipython \ - kernelspec install-self \ No newline at end of file + kernelspec install-self + diff --git a/scipy-notebook/Dockerfile b/scipy-notebook/Dockerfile index df801ad3..c177105f 100644 --- a/scipy-notebook/Dockerfile +++ b/scipy-notebook/Dockerfile @@ -52,3 +52,4 @@ USER root RUN $CONDA_DIR/envs/python2/bin/python \ $CONDA_DIR/envs/python2/bin/ipython \ kernelspec install-self +