blob: 150bb761e9ea2574d2b9bc3f1963059b3ac3ec82 [file] [log] [blame]
Earl Lee2e463fb2025-04-17 11:22:22 -07001FROM golang:1.24.2-alpine3.21
2
Philip Zeyligercc3ba222025-04-23 14:52:21 -07003RUN apk add bash git make jq sqlite gcc musl-dev linux-headers npm nodejs go github-cli ripgrep fzf python3 curl vim
Earl Lee2e463fb2025-04-17 11:22:22 -07004
5ENV GOTOOLCHAIN=auto
6ENV GOPATH=/go
7ENV PATH="$GOPATH/bin:$PATH"
8
9RUN go install golang.org/x/tools/cmd/goimports@latest
10RUN go install golang.org/x/tools/gopls@latest
11RUN go install mvdan.cc/gofumpt@latest
12
David Crawshawbe10fa92025-04-18 01:16:00 -070013RUN mkdir -p /root/.cache/sketch/webui
14
Philip Zeyligercc3ba222025-04-23 14:52:21 -070015RUN apk add --no-cache ca-certificates && \
16 update-ca-certificates
David Crawshawbe10fa92025-04-18 01:16:00 -070017
Philip Zeyligercc3ba222025-04-23 14:52:21 -070018# Set up Go environment variables
David Crawshawbe10fa92025-04-18 01:16:00 -070019ENV CGO_ENABLED=1
Philip Zeyligercc3ba222025-04-23 14:52:21 -070020ENV GO111MODULE=on
David Crawshawbe10fa92025-04-18 01:16:00 -070021
Philip Zeyligercc3ba222025-04-23 14:52:21 -070022# Install any additional dependencies if needed
23RUN apk add --no-cache openssh-client || true
24
25# Create necessary directories
26RUN mkdir -p /root/.config/gh
Earl Lee2e463fb2025-04-17 11:22:22 -070027
28ARG GIT_USER_EMAIL
29ARG GIT_USER_NAME
30
31RUN git config --global user.email "$GIT_USER_EMAIL" && \
32 git config --global user.name "$GIT_USER_NAME"
33
Philip Zeyligercc3ba222025-04-23 14:52:21 -070034LABEL sketch_context="ecacc023382f310d25253734931f73bdfa48bd71cd92bd2c3ae1a6099ce5eb40"
Earl Lee2e463fb2025-04-17 11:22:22 -070035COPY . /app
36
37WORKDIR /app
38RUN if [ -f go.mod ]; then go mod download; fi
39
40CMD ["/bin/sketch"]