Skip to content

Commit

Permalink
define the python version for the conda env to match the debian syste…
Browse files Browse the repository at this point in the history
…m python. natcap#1560
  • Loading branch information
davemfish committed Apr 22, 2024
1 parent e5dd80e commit da3e9b1
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,21 @@ RUN cd / && \

# Create the container for distribution that has runtime dependencies.
FROM mambaorg/micromamba:1.5.0-bookworm-slim

# Python version should match the version used in stage 1.
# If we update the stage 1 debian version, also update this python version
ARG PYTHON_VERSION="3.11"

COPY --from=build /invest/dist/*.whl /tmp/

# The environment.yml file will be built during github actions.
COPY --chown=$MAMBA_USER:$MAMBA_USER environment.yml /tmp/environment.yml
RUN micromamba install -y -n base -c conda-forge -f /tmp/environment.yml && \
RUN micromamba create -n invest-env -c conda-forge python==${PYTHON_VERSION} && \
micromamba activate invest-env && \
micromamba install -y -c conda-forge -f /tmp/environment.yml && \
micromamba clean --all --yes && \
/opt/conda/bin/python -m pip install /tmp/*.whl && \
/opt/conda/bin/python -m pip cache purge && \
micromamba remove -y -n base cxx-compiler git
python -m pip install /tmp/*.whl && \
python -m pip cache purge && \
micromamba remove -y cxx-compiler git

ENTRYPOINT ["/usr/local/bin/_entrypoint.sh"]

0 comments on commit da3e9b1

Please sign in to comment.