Skip to content

Commit

Permalink
Allowing invest repo and build ref to be provided as build args. RE:n…
Browse files Browse the repository at this point in the history
  • Loading branch information
phargogh committed Oct 19, 2023
1 parent 8cac295 commit b9d38db
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# syntax=docker/dockerfile:1

ARG INVEST_VERSION=main
ARG INVEST_REPO=natcap/invest

# Build the InVEST wheel in a separate container stage
FROM debian:12.2 as build
RUN apt update && apt install -y python3 python3-dev python3-pip python3-build build-essential
RUN python3 -m build && pwd
RUN apt update && apt install -y python3 python3-dev python3-pip python3-build build-essential git
RUN git clone https://github.com/${INVEST_REPO}.git && \
cd invest && \
git checkout ${INVEST_VERSION} && \
python3 -m build

# Create the container for distribution that has runtime dependencies.
FROM mambaorg/micromamba:1.5.0-bookworm-slim
COPY --from=build /dist/*.whl /tmp/
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
Expand Down

0 comments on commit b9d38db

Please sign in to comment.