File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ FROM golang:1.24.4-alpine AS build
2+ ARG VERSION="dev"
3+
4+ # Set the working directory
5+ WORKDIR /build
6+
7+ # Install git
8+ RUN --mount=type=cache,target=/var/cache/apk \
9+ apk add git
10+
11+ # Build the server
12+ # go build automatically download required module dependencies to /go/pkg/mod
13+ RUN --mount=type=cache,target=/go/pkg/mod \
14+ --mount=type=cache,target=/root/.cache/go-build \
15+ --mount=type=bind,target=. \
16+ CGO_ENABLED=0 go build -ldflags="-s -w -X main.version=${VERSION} -X main.commit=$(git rev-parse HEAD) -X main.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
17+ -o /bin/github-mcp-server cmd/github-mcp-server/main.go
18+
19+ # Make a stage to run the app
20+ FROM alpine:3.21
21+ RUN apk add --no-cache ca-certificates
22+ # Set the working directory
23+ WORKDIR /server
24+ # Copy the binary from the build stage
25+ COPY --from=build /bin/github-mcp-server .
26+ # Set the entrypoint to the server binary
27+ ENTRYPOINT ["/server/github-mcp-server"]
28+ # Default arguments for ENTRYPOINT
29+ CMD ["stdio"]
You can’t perform that action at this time.
0 commit comments