| Earl Lee | 2e463fb | 2025-04-17 11:22:22 -0700 | [diff] [blame] | 1 | FROM golang:1.24.2-alpine3.21 |
| 2 | |
| Philip Zeyliger | cc3ba22 | 2025-04-23 14:52:21 -0700 | [diff] [blame] | 3 | RUN apk add bash git make jq sqlite gcc musl-dev linux-headers npm nodejs go github-cli ripgrep fzf python3 curl vim |
| Earl Lee | 2e463fb | 2025-04-17 11:22:22 -0700 | [diff] [blame] | 4 | |
| 5 | ENV GOTOOLCHAIN=auto |
| 6 | ENV GOPATH=/go |
| 7 | ENV PATH="$GOPATH/bin:$PATH" |
| 8 | |
| 9 | RUN go install golang.org/x/tools/cmd/goimports@latest |
| 10 | RUN go install golang.org/x/tools/gopls@latest |
| 11 | RUN go install mvdan.cc/gofumpt@latest |
| 12 | |
| David Crawshaw | be10fa9 | 2025-04-18 01:16:00 -0700 | [diff] [blame] | 13 | RUN mkdir -p /root/.cache/sketch/webui |
| 14 | |
| Philip Zeyliger | cc3ba22 | 2025-04-23 14:52:21 -0700 | [diff] [blame] | 15 | RUN apk add --no-cache ca-certificates && \ |
| 16 | update-ca-certificates |
| David Crawshaw | be10fa9 | 2025-04-18 01:16:00 -0700 | [diff] [blame] | 17 | |
| Philip Zeyliger | cc3ba22 | 2025-04-23 14:52:21 -0700 | [diff] [blame] | 18 | # Set up Go environment variables |
| David Crawshaw | be10fa9 | 2025-04-18 01:16:00 -0700 | [diff] [blame] | 19 | ENV CGO_ENABLED=1 |
| Philip Zeyliger | cc3ba22 | 2025-04-23 14:52:21 -0700 | [diff] [blame] | 20 | ENV GO111MODULE=on |
| David Crawshaw | be10fa9 | 2025-04-18 01:16:00 -0700 | [diff] [blame] | 21 | |
| Philip Zeyliger | cc3ba22 | 2025-04-23 14:52:21 -0700 | [diff] [blame] | 22 | # Install any additional dependencies if needed |
| 23 | RUN apk add --no-cache openssh-client || true |
| 24 | |
| 25 | # Create necessary directories |
| 26 | RUN mkdir -p /root/.config/gh |
| Earl Lee | 2e463fb | 2025-04-17 11:22:22 -0700 | [diff] [blame] | 27 | |
| 28 | ARG GIT_USER_EMAIL |
| 29 | ARG GIT_USER_NAME |
| 30 | |
| 31 | RUN git config --global user.email "$GIT_USER_EMAIL" && \ |
| 32 | git config --global user.name "$GIT_USER_NAME" |
| 33 | |
| Philip Zeyliger | cc3ba22 | 2025-04-23 14:52:21 -0700 | [diff] [blame] | 34 | LABEL sketch_context="ecacc023382f310d25253734931f73bdfa48bd71cd92bd2c3ae1a6099ce5eb40" |
| Earl Lee | 2e463fb | 2025-04-17 11:22:22 -0700 | [diff] [blame] | 35 | COPY . /app |
| 36 | |
| 37 | WORKDIR /app |
| 38 | RUN if [ -f go.mod ]; then go mod download; fi |
| 39 | |
| 40 | CMD ["/bin/sketch"] |