5

I am trying to build a custom Docker Image using jupyter/datascience-notebook which is based off of jupyter/base-notebook

I can see that mamba was used to install/configure conda environment for jupyter.

Below is my Dockerfile (the portion which the question is about)

#REF: https://stackoverflow.com/q/66547389

RUN /opt/conda/bin/conda create -n pypy pypy ipykernel -y
RUN /opt/conda/envs/pypy/bin/pypy -m ipykernel install --prefix=/opt/conda/ --name pypy3 --display-name="pypy3"

#-- INSTALL JUPYTERLAB PLUGINS --#
RUN /opt/conda/bin/conda install -c conda-forge jupyterlab-git
RUN /opt/conda/bin/conda install -c conda-forge jupyter-resource-usage

My question - should I actually be using mamba instead of /opt/conda/bin/conda since Mamba is a wrapper on conda? Or, am I doing the right thing?

Regards,

ha9u63a7
  • 6,233
  • 16
  • 73
  • 108

1 Answers1

8

In terms of functionality, either conda or mamba should work. I'd generally choose mamba over conda as mamba is faster than conda, but some may prefer conda as it is a more mature project.

conda is implemented in python, and therefore is not the fastest implementation possible. mamba is not a wrapper on conda, but a partial re-implementation that is focused on performance. mamba is written in C++, does parallel downloading of repository data and package files using multi-threading, and utilizes libsolv for much faster dependency solving. mamba utilities some of the conda code base for tasks that are not critical to performance and therefore mamba has a dependency on python.

Another option is micromamba, which is a purely C++ re-implementation of conda and does not have a dependency on python. If you are creating a new image from scratch and you do not need python in your image, then you should use micromamba to keep your resulting image small. The image mambaorg/micromamba is a good starting point (full disclosure, I am the lead maintainer of this image).

As of March 16, 2022, it is possible to use mamba's solver from within conda.

Will Holtz
  • 677
  • 5
  • 17
  • hello dear Will - well its somewhat confusing i just read this article https://stackoverflow.com/questions/45421163/anaconda-vs-miniconda and i just got to know that mamba exists - i am a bit confused. Should i install this now!? plz help and adviced - btw i am on endeavourOS – thannen Oct 02 '22 at 22:58