Skip to content

Commit fa8c23a

Browse files
add ld flags so version is included in docker releases (#73)
1 parent a14e982 commit fa8c23a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: Dockerfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
ARG VERSION="dev"
2+
13
FROM golang:1.23.7 AS build
24
# Set the working directory
35
WORKDIR /build
@@ -6,7 +8,8 @@ COPY . .
68
# Install dependencies
79
RUN go mod download
810
# Build the server
9-
RUN CGO_ENABLED=0 go build -o github-mcp-server cmd/github-mcp-server/main.go
11+
RUN 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)" \
12+
-o github-mcp-server cmd/github-mcp-server/main.go
1013
# Make a stage to run the app
1114
FROM gcr.io/distroless/base-debian12
1215
# Set the working directory

0 commit comments

Comments
 (0)