blob: 55e9245208240704019b0daa740600d8cb3f4ff9 [file] [log] [blame]
David Crawshawb7a06632025-05-05 09:52:20 -07001FROM ghcr.io/boldsoftware/sketch:f5b4ebd9ca15d3dbd2cd08e6e7ab9548
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
David Crawshaw8fd51042025-05-05 12:52:43 -070010LABEL sketch_context="852a43dfbf76c6272f41ade86ac1b4567acb77141edfec6c1df20b07a4758d1a"
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 Crawshaw8fd51042025-05-05 12:52:43 -070020# Install any Go tools that might be useful for development
21go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest || true
22go install github.com/rakyll/gotest@latest || true
23
24# Install Python dependencies if needed (with error handling)
25if [ -f requirements.txt ]; then
26 pip3 install -r requirements.txt || true
27fi
28
29# If Makefile exists, run make prepare or similar setup target
30if [ -f Makefile ]; then
31 grep -q "prepare:" Makefile && make prepare || true
32fi
David Crawshawb7a06632025-05-05 09:52:20 -070033
34# Switch back to strict shell after extra_cmds.
35SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]
David Crawshaw11129492025-04-25 20:41:53 -070036
37CMD ["/bin/sketch"]