blob: d3bec5b1fd19a9755414eaf560132aba409dd0b0 [file] [log] [blame]
Philip Zeyliger33d282f2025-05-03 04:01:54 +00001FROM ghcr.io/boldsoftware/sketch:99a2e4afe316b3c6cf138830dbfb7796
Earl Lee2e463fb2025-04-17 11:22:22 -07002
3ARG 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="731625e8ccb108e34ec80ec82ad2eff3d65cd962c13cc9a33e3456d828b48b65"
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"]
Josh Bleecher Snyderc76a3922025-05-01 01:18:56 +000019
David Crawshaw53b02a62025-05-12 14:46:29 -070020RUN go mod tidy || true
David Crawshaw8fd51042025-05-05 12:52:43 -070021
David Crawshaw53b02a62025-05-12 14:46:29 -070022# Install any Python dependencies if a requirements.txt exists, but continue on failure
Philip Zeyliger33d282f2025-05-03 04:01:54 +000023RUN if [ -f requirements.txt ]; then pip3 install -r requirements.txt || true; fi
David Crawshaw8fd51042025-05-05 12:52:43 -070024
David Crawshaw53b02a62025-05-12 14:46:29 -070025# Install any npm dependencies if package.json exists
26RUN if [ -f package.json ]; then npm install || true; fi
27
28# Install additional tools that might be useful for Go development
29RUN go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest || true
30
31# Install any additional needed packages
32RUN apt-get update && apt-get install -y --no-install-recommends \
33 make \
34 protobuf-compiler \
35 || true
David Crawshawb7a06632025-05-05 09:52:20 -070036
37# Switch back to strict shell after extra_cmds.
38SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]
David Crawshaw11129492025-04-25 20:41:53 -070039
40CMD ["/bin/sketch"]