Skip to content

Commit

Permalink
fix: uv pip install to use --platform arg
Browse files Browse the repository at this point in the history
  • Loading branch information
jarvis8x7b committed Sep 27, 2024
1 parent 533fc7b commit ac60722
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,17 @@ RUN apt-get update \

COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
COPY . .
RUN chmod +x entrypoints.sh \
&& uv pip install --no-cache -e . --find-links https://download.pytorch.org/whl/torch_stable.html
RUN chmod +x entrypoints.sh

ARG TARGETPLATFORM

RUN echo "Building for TARGETPLATFORM: $TARGETPLATFORM"

# jank as fuck because pytorch has different versions for cpu for darwin VS linux, see pyproject.toml for specifics
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
uv pip install --no-cache -e . --find-links https://download.pytorch.org/whl/torch_stable.html; \
else \
uv pip install --no-cache -e .; \
fi

ENTRYPOINT ["./entrypoints.sh"]

0 comments on commit ac60722

Please sign in to comment.