Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using multi-stage build for Conda based containers #682

Open
pditommaso opened this issue Oct 9, 2024 · 0 comments
Open

Consider using multi-stage build for Conda based containers #682

pditommaso opened this issue Oct 9, 2024 · 0 comments

Comments

@pditommaso
Copy link
Collaborator

It should be evaluated the sue of multi-stage build for Conda based containers. For example

FROM mambaorg/micromamba:1.5.10-noble 
COPY --chown=$MAMBA_USER:$MAMBA_USER conda.yml /tmp/conda.yml
RUN micromamba install -y -n base -f /tmp/conda.yml \
    && micromamba install -y -n base conda-forge::procps-ng \
    && micromamba env export --name base --explicit > environment.lock \
    && echo ">> CONDA_LOCK_START" \
    && cat environment.lock \
    && echo "<< CONDA_LOCK_END" \
    && micromamba clean -a -y
USER root

FROM ubuntu:noble
COPY --from=0 /opt/conda /opt/conda
USER root
ENV PATH="/opt/conda/bin:$PATH"

This would result in:

  • slightly smaller container images
  • ability to control the base image independently of the build image
@pditommaso pditommaso changed the title Consider using mult-stage build for Conda based containers Consider using multi-stage build for Conda based containers Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant