Files
github--github-mcp-server/Dockerfile
T
Babbage 35b0da2495
License Check / license-check (push) Has been cancelled
Publish to MCP Registry / publish (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
Docker / build (push) Has been cancelled
Build and Test Go Project / build (macos-latest) (push) Has been cancelled
Build and Test Go Project / build (ubuntu-latest) (push) Has been cancelled
Build and Test Go Project / build (windows-latest) (push) Has been cancelled
GoReleaser Release / release (push) Has been cancelled
Add container label & improve registry script (#1143)
* Add publish script and formed server file

* Add dockerfile label and clean script

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-26 12:08:03 +01:00

33 lines
1.0 KiB
Docker

FROM golang:1.25.1-alpine AS build
ARG VERSION="dev"
# Set the working directory
WORKDIR /build
# Install git
RUN --mount=type=cache,target=/var/cache/apk \
apk add git
# Build the server
# go build automatically download required module dependencies to /go/pkg/mod
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
--mount=type=bind,target=. \
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)" \
-o /bin/github-mcp-server cmd/github-mcp-server/main.go
# Make a stage to run the app
FROM gcr.io/distroless/base-debian12
# Add required MCP server annotation
LABEL io.modelcontextprotocol.server.name="io.github.github/github-mcp-server"
# Set the working directory
WORKDIR /server
# Copy the binary from the build stage
COPY --from=build /bin/github-mcp-server .
# Set the entrypoint to the server binary
ENTRYPOINT ["/server/github-mcp-server"]
# Default arguments for ENTRYPOINT
CMD ["stdio"]