blob: b98c741e8bea5ff202f0a8cb664746db22b9aac8 [file] [log] [blame]
Philip Zeyliger33d282f2025-05-03 04:01:54 +00001FROM ghcr.io/boldsoftware/sketch:99a2e4afe316b3c6cf138830dbfb7796
David Crawshawbe10fa92025-04-18 01:16:00 -07002
Earl Lee2e463fb2025-04-17 11:22:22 -07003ARG GIT_USER_EMAIL
4ARG GIT_USER_NAME
5
6RUN git config --global user.email "$GIT_USER_EMAIL" && \
David Crawshawca535582025-05-03 13:04:34 -07007 git config --global user.name "$GIT_USER_NAME" && \
8 git config --global http.postBuffer 524288000
Earl Lee2e463fb2025-04-17 11:22:22 -07009
Philip Zeyliger33d282f2025-05-03 04:01:54 +000010LABEL sketch_context="7c933e98fc1d5fd35f964b6cf115bcf65b580c378069d078ab66723b2b1073c4"
Earl Lee2e463fb2025-04-17 11:22:22 -070011COPY . /app
David Crawshaw8fd51042025-05-05 12:52:43 -070012RUN rm -f /app/tmp-sketch-dockerfile
Earl Lee2e463fb2025-04-17 11:22:22 -070013
14WORKDIR /app
15RUN if [ -f go.mod ]; then go mod download; fi
16
David Crawshawb7a06632025-05-05 09:52:20 -070017# Switch to lenient shell so we are more likely to get past failing extra_cmds.
18SHELL ["/bin/bash", "-uo", "pipefail", "-c"]
19
Philip Zeyliger33d282f2025-05-03 04:01:54 +000020# Install Python 3.11 (attempt to continue on failure)
21RUN apt-get update && apt-get install -y --no-install-recommends python3.11 python3.11-venv python3.11-dev python3-pip || true
Josh Bleecher Snyderc76a3922025-05-01 01:18:56 +000022
Philip Zeyliger33d282f2025-05-03 04:01:54 +000023# Set up Python 3.11 as default Python
24RUN if command -v python3.11 &> /dev/null; then \
25 update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 || true; \
26 fi
27
28# Install DVC tool
David Crawshaw8fd51042025-05-05 12:52:43 -070029RUN pip3 install dvc || true
30
Philip Zeyliger33d282f2025-05-03 04:01:54 +000031# Create and activate Python virtual environment if needed
32RUN if [ -f requirements.txt ]; then \
33 python3 -m venv .venv || true; \
34 source .venv/bin/activate || true; \
35 pip install -r requirements.txt || true; \
36 fi
37
David Crawshawb7a06632025-05-05 09:52:20 -070038# Switch back to strict shell after extra_cmds.
39SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]
David Crawshaw11129492025-04-25 20:41:53 -070040
41CMD ["/bin/sketch"]