Hi team,
Our organization is transitioning from Conda to Mamba for Jupyter products. As part of this transition, I am creating a Docker image. Here is the Dockerfile I have prepared.
FROM existing_jupyter_image
Set environment variables
ENV MAMBA_ROOT_PREFIX=/opt/mamba
DEBIAN_FRONTEND=noninteractive
MICROMAMBA_VERSION=0.16.0
ENV_FILE_PATH=/tmp/environment.yml
#removing conda in existing image
RUN mv /opt/conda /opt/conda_bkp/
Install micromamba
RUN apt-get update &&
apt-get install -y curl &&
curl -Ls https://micromamba.snakepit.net/api/micromamba/linux-64/${MICROMAMBA_VERSION} | tar -xvj bin/micromamba -C /tmp &&
/tmp/bin/micromamba shell init -s bash -p ${MAMBA_ROOT_PREFIX} &&
rm -rf /tmp/* &&
apt-get remove -y curl &&
apt-get autoremove -y &&
apt-get clean &&
rm -rf /var/lib/apt/lists/*
Copy environment.yml into the Docker image
COPY environment.yml ${ENV_FILE_PATH}
Create the base environment using mamba
RUN /opt/mamba/bin/micromamba create --yes -n base -c conda-forge -f ${ENV_FILE_PATH} &&
/opt/mamba/bin/micromamba clean --all --yes &&
rm ${ENV_FILE_PATH}
Activate the base environment
SHELL [“/bin/bash”, “-c”]
RUN source /opt/mamba/etc/profile.d/mamba.sh &&
micromamba activate base
Set default command
CMD [“jupyter”, “notebook”, “–ip=0.0.0.0”, “–no-browser”, “–allow-root”]
Could you please review it and provide any necessary inputs for building the image?
Thank you."