Commit d4cc8f88 authored by William Tucker's avatar William Tucker
Browse files

Updated conda base image for Rocky9 and to use mamba

parent 3d2cc7e6
Loading
Loading
Loading
Loading
+17 −12
Original line number Diff line number Diff line
@@ -9,24 +9,29 @@ FROM ${ESGF_REPOSITORY_BASE}/base:${ESGF_IMAGES_VERSION}
USER root

# Configure environment
ENV CONDA_HOME /opt/conda
ENV PATH $CONDA_HOME/bin:$PATH
ENV MAMBA_HOME /opt/conda
ENV PATH $MAMBA_HOME/bin:$PATH
# Don't buffer stdout and stderr as it breaks realtime logging
ENV PYTHONUNBUFFERED 1

# Install and configure Conda
ENV CONDA_VERSION=py37_4.8.3
RUN curl -fsSL -o miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-$CONDA_VERSION-Linux-x86_64.sh && \
    echo "bb2e3cedd2e78a8bb6872ab3ab5b1266a90f8c7004a22d8dc2ea5effeb6a439a *miniconda.sh" | sha256sum --check - && \
    /bin/bash miniconda.sh -f -b -p $CONDA_HOME && \
    rm miniconda.sh && \
    echo "conda ${CONDA_VERSION}" >> $CONDA_HOME/conda-meta/pinned && \
    conda config --system --prepend channels conda-forge && \
ARG CONDA_VERSION=23.11.0
ARG MF_RELEASE=0
ARG MF_MD5SUM=ee57176f95c313b23850e0221498f8e8
ARG MF_VERSION=$CONDA_VERSION-$MF_RELEASE
ARG INSTALLER=miniconda.sh
ARG ACTIVATE_SCRIPT=/usr/local/bin/mamba_activate.sh
RUN curl -fsSL -o $INSTALLER https://github.com/conda-forge/miniforge/releases/download/$MF_VERSION/Miniforge3-$MF_VERSION-Linux-x86_64.sh && \
    echo "${MF_MD5SUM} ${INSTALLER}" | md5sum --check - && \
    /bin/bash $INSTALLER -f -b -p $MAMBA_HOME && \
    rm $INSTALLER && \
    echo "conda ${CONDA_VERSION}" >> $MAMBA_HOME/conda-meta/pinned && \
    ${MAMBA_HOME}/bin/conda shell.bash hook > $ACTIVATE_SCRIPT && \
    . $ACTIVATE_SCRIPT && \
    conda config --system --set auto_update_conda false && \
    conda config --system --set show_channel_urls true && \
    conda install --quiet --yes conda && \
    conda update --all --quiet --yes && \
    conda list python | grep '^python ' | tr -s ' ' | cut -d '.' -f 1,2 | sed 's/$/.*/' >> $CONDA_HOME/conda-meta/pinned && \
    mamba update --all --quiet --yes && \
    conda list python | grep '^python ' | tr -s ' ' | cut -d '.' -f 1,2 | sed 's/$/.*/' >> $MAMBA_HOME/conda-meta/pinned && \
    conda clean --all -f -y

USER $ESGF_UID