micromamba-docker: Error when mamba.sh exists
Whenever micromamba shell hook -s bash is executed and $MAMBA_ROOT_PREFIX/etc/profile.d/mamba.sh exists, then the output seems to be mamba.sh. The standard mamba.sh initialization script defines only the mamba() shell function, leaving conda() and micromamba() undefined.
EDIT: while the issue described immediately below has a workaround, the comment https://github.com/mamba-org/micromamba-docker/issues/57#issuecomment-996556375 illustrates the latest breakage.
The entrypoint.sh for this image calls
eval "$(/bin/micromamba shell hook -s bash)"
micromamba activate "$ENV_NAME"
If mamba.sh exists (for example if the user installs mamba), then the micromamba command above refers to the binary instead of the shell function, it results in the following error message:
The following arguments were not expected: base activate
Run with --help for more information.
To reproduce, use either of these Dockerfiles:
FROM mambaorg/micromamba:0.18.2
RUN micromamba install -c conda-forge --prefix=$MAMBA_ROOT_PREFIX mamba
FROM mambaorg/micromamba:0.18.2
RUN mkdir -p /opt/conda/etc/profile.d/ \
&& echo "echo Ran mamba.sh" > /opt/conda/etc/profile.d/mamba.sh
and then run
docker build . -t micromamba-docker-issue-57
docker run --rm -it micromamba-docker-issue-57
and you will see the output
Ran mamba.sh
The following arguments were not expected: base activate
Run with --help for more information.
It seems to me like the proper fix should probably be upstream in micromamba to ensure that micromamba(), mamba(), and conda() are always defined in the shell init. For example, maybe it should ignore mamba.sh, or use mamba.sh and append the definition of micromamba()?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (8 by maintainers)
Commits related to this issue
- More robust activation in _entrypoint.sh Works around #57 — committed to maresb/micromamba-docker by maresb 3 years ago
Fixed with #69