update conda builder
update miniconda to 4.3
pin more packages
install conda and required packages in one layer
install in conda root env
avoid updating dependencies automatically when pulling in new packages
MODIFY
singleuser-builder-conda/Dockerfile
singleuser-builder-conda/Dockerfile
@@ -13,22 +13,21 @@ RUN apt-get update && \
git && \
apt-get purge && apt-get clean
-ENV CONDA_DIR /opt/conda
-ENV PATH $CONDA_DIR/envs/base/bin:$CONDA_DIR/bin/:$PATH
-ENV NB_USER jovyan
+ENV CONDA_DIR=/opt/conda \
+ PATH=/opt/conda/bin:$PATH \
+ NB_USER=jovyan \
+ HOME=/home/jovyan
RUN adduser --disabled-password --gecos "Default Jupyter user" ${NB_USER}
-WORKDIR /home/${NB_USER}
-ADD install-miniconda.bash /usr/local/bin/install-miniconda.bash
+WORKDIR $HOME
+ADD install-miniconda.bash /tmp/
+ADD environment.yml /tmp/
-RUN /usr/local/bin/install-miniconda.bash
+RUN bash /tmp/install-miniconda.bash && \
+ rm /tmp/install-miniconda.bash /tmp/environment.yml
USER $NB_USER
-ADD environment.yml .
-RUN conda env create --quiet -n base && conda clean -tipsy
-RUN rm environment.yml
-
COPY ./s2i/bin/ /usr/libexec/s2i
EXPOSE 8888

MODIFY
singleuser-builder-conda/Makefile
singleuser-builder-conda/Makefile
-IMAGE_NAME = jupyterhub/singleuser-builder-miniconda
+IMAGE_NAME = jupyterhub/singleuser-builder-conda
VERSION = $(shell cat version)
.PHONY: build

MODIFY
singleuser-builder-conda/environment.yml
singleuser-builder-conda/environment.yml
-name: base
dependencies:
+ - python==3.6.1
- notebook==5.0.0
+ - ipython==6.0.0
- ipykernel==4.6.0
- ipywidgets==6.0.0
- pip:

MODIFY
singleuser-builder-conda/install-miniconda.bash
singleuser-builder-conda/install-miniconda.bash
#!/bin/bash
# This downloads and installs a pinned version of miniconda
-set -e
+set -ex
-CONDA_VERSION=4.2.12
+cd $(dirname $0)
+CONDA_VERSION=4.3.14
URL="https://repo.continuum.io/miniconda/Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh"
-INSTALLER_PATH=/usr/local/sbin/miniconda-installer
+INSTALLER_PATH=/tmp/miniconda-installer.sh
wget --quiet $URL -O ${INSTALLER_PATH}
chmod +x ${INSTALLER_PATH}
# Only MD5 checksums are available for miniconda
# Can be obtained from https://repo.continuum.io/miniconda/
-MD5SUM="d0c7c71cc5659e54ab51f2005a8d96f3"
+MD5SUM="fc6fc37479e3e3fcf3f9ba52cae98991"
if ! echo "${MD5SUM} ${INSTALLER_PATH}" | md5sum --quiet -c -; then
echo "md5sum mismatch for ${INSTALLER_PATH}, exiting!"
exit 1
fi
-${INSTALLER_PATH} -f -b -p ${CONDA_DIR}
+bash ${INSTALLER_PATH} -b -p ${CONDA_DIR}
# Allow easy direct installs from conda forge
${CONDA_DIR}/bin/conda config --system --add channels conda-forge
-# Do not attempt to auto update conda
+# Do not attempt to auto update conda or dependencies
${CONDA_DIR}/bin/conda config --system --set auto_update_conda false
+${CONDA_DIR}/bin/conda config --system --set update_dependencies false
+${CONDA_DIR}/bin/conda config --system --set show_channel_urls true
+${CONDA_DIR}/bin/conda env update -n root -f /tmp/environment.yml
# Clean things out!
${CONDA_DIR}/bin/conda clean -tipsy

MODIFY
singleuser-builder-conda/s2i/bin/assemble
singleuser-builder-conda/s2i/bin/assemble
@@ -19,7 +19,7 @@ cp -Rf /tmp/src/. .
echo "---> Building application from source..."
if [ -f environment.yml ]; then
- conda env update -n base -f environment.yml
+ conda env update -n root -f environment.yml
elif [ -f requirements.txt ]; then
pip install -r requirements.txt
fi

MODIFY
singleuser-builder-conda/s2i/bin/run
singleuser-builder-conda/s2i/bin/run
# https://github.com/openshift/source-to-image/blob/master/docs/builder_image.md
#
-source activate base
exec jupyter notebook --ip=0.0.0.0

MODIFY
singleuser-builder-conda/version
singleuser-builder-conda/version
-v0.1.4
+v0.1.5

update conda builder

- update miniconda to 4.3
- pin more packages
- install conda and required packages in one layer
- install in conda root env
- avoid updating dependencies automatically when pulling in new packages