Skip to content

Commit 9fd29ab

Browse files
committed
Extend nextstrain/base with mamba
1 parent 6f92b0c commit 9fd29ab

1 file changed

Lines changed: 11 additions & 19 deletions

File tree

Dockerfile

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
1-
# Stage 1: Create conda environment
2-
FROM mambaorg/micromamba:2.0.8 AS conda-builder
3-
4-
COPY --chown=$MAMBA_USER:$MAMBA_USER env.yaml /tmp/env.yaml
5-
RUN micromamba create -y -n env -f /tmp/env.yaml && \
6-
micromamba clean --all --yes
7-
8-
# Stage 2: Build final image extending nextstrain/base
91
FROM nextstrain/base:latest
102

11-
# Copy the conda environment from the previous stage
12-
COPY --from=conda-builder /opt/conda/envs/env /opt/conda/envs/env
13-
14-
# Add environment bin to PATH
15-
# Notes:
16-
# 1. This makes the conda-installed tools available but isn't equivalent to
17-
# activating the environment since micromamba itself is not part of the final
18-
# image.
19-
# 2. nextstrain/base puts programs in /usr/local/bin, and those should take
20-
# precedence.
21-
ENV PATH="/usr/local/bin:/opt/conda/envs/env/bin:$PATH"
3+
# Install micromamba and set up root
4+
# FIXME: check permissions
5+
RUN curl -L micro.mamba.pm/install.sh | bash && \
6+
ln -s micromamba /nextstrain/.local/bin/mamba && \
7+
mkdir -p /nextstrain/micromamba && \
8+
chmod -R 777 /nextstrain/micromamba
9+
ENV MAMBA_EXE=/nextstrain/.local/bin/micromamba
10+
ENV MAMBA_ROOT_PREFIX=/nextstrain/micromamba
11+
12+
# Make mamba/micromamba available in PATH
13+
ENV PATH="/nextstrain/.local/bin:$MAMBA_ROOT_PREFIX/bin:$PATH"

0 commit comments

Comments
 (0)