| David Crawshaw | b7a0663 | 2025-05-05 09:52:20 -0700 | [diff] [blame] | 1 | FROM ghcr.io/boldsoftware/sketch:f5b4ebd9ca15d3dbd2cd08e6e7ab9548 |
| Earl Lee | 2e463fb | 2025-04-17 11:22:22 -0700 | [diff] [blame] | 2 | |
| 3 | ARG GIT_USER_EMAIL |
| 4 | ARG GIT_USER_NAME |
| 5 | |
| 6 | RUN git config --global user.email "$GIT_USER_EMAIL" && \ |
| David Crawshaw | ca53558 | 2025-05-03 13:04:34 -0700 | [diff] [blame] | 7 | git config --global user.name "$GIT_USER_NAME" && \ |
| 8 | git config --global http.postBuffer 524288000 |
| Earl Lee | 2e463fb | 2025-04-17 11:22:22 -0700 | [diff] [blame] | 9 | |
| David Crawshaw | 8fd5104 | 2025-05-05 12:52:43 -0700 | [diff] [blame] | 10 | LABEL sketch_context="852a43dfbf76c6272f41ade86ac1b4567acb77141edfec6c1df20b07a4758d1a" |
| Earl Lee | 2e463fb | 2025-04-17 11:22:22 -0700 | [diff] [blame] | 11 | COPY . /app |
| David Crawshaw | 8fd5104 | 2025-05-05 12:52:43 -0700 | [diff] [blame] | 12 | RUN rm -f /app/tmp-sketch-dockerfile |
| Earl Lee | 2e463fb | 2025-04-17 11:22:22 -0700 | [diff] [blame] | 13 | |
| 14 | WORKDIR /app |
| 15 | RUN if [ -f go.mod ]; then go mod download; fi |
| 16 | |
| David Crawshaw | b7a0663 | 2025-05-05 09:52:20 -0700 | [diff] [blame] | 17 | # Switch to lenient shell so we are more likely to get past failing extra_cmds. |
| 18 | SHELL ["/bin/bash", "-uo", "pipefail", "-c"] |
| Josh Bleecher Snyder | c76a392 | 2025-05-01 01:18:56 +0000 | [diff] [blame] | 19 | |
| David Crawshaw | 8fd5104 | 2025-05-05 12:52:43 -0700 | [diff] [blame] | 20 | # Install any Go tools that might be useful for development |
| 21 | go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest || true |
| 22 | go install github.com/rakyll/gotest@latest || true |
| 23 | |
| 24 | # Install Python dependencies if needed (with error handling) |
| 25 | if [ -f requirements.txt ]; then |
| 26 | pip3 install -r requirements.txt || true |
| 27 | fi |
| 28 | |
| 29 | # If Makefile exists, run make prepare or similar setup target |
| 30 | if [ -f Makefile ]; then |
| 31 | grep -q "prepare:" Makefile && make prepare || true |
| 32 | fi |
| David Crawshaw | b7a0663 | 2025-05-05 09:52:20 -0700 | [diff] [blame] | 33 | |
| 34 | # Switch back to strict shell after extra_cmds. |
| 35 | SHELL ["/bin/bash", "-euxo", "pipefail", "-c"] |
| David Crawshaw | 1112949 | 2025-04-25 20:41:53 -0700 | [diff] [blame] | 36 | |
| 37 | CMD ["/bin/sketch"] |