Skip to content

Commit a22dd6e

Browse files
nficanoclaude
andcommitted
Simplify Dockerfile to use pre-built binary from GoReleaser
GoReleaser builds the binary and copies it into the Docker build context, so the multi-stage Go compilation is unnecessary and breaks the build (go.sum not present in the context). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7c1e46b commit a22dd6e

1 file changed

Lines changed: 1 addition & 23 deletions

File tree

Dockerfile

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,3 @@
1-
FROM golang:1.22-alpine AS builder
2-
3-
RUN apk add --no-cache git ca-certificates
4-
5-
WORKDIR /src
6-
7-
COPY go.mod go.sum ./
8-
RUN go mod download
9-
10-
COPY . .
11-
12-
ARG VERSION=dev
13-
ARG COMMIT=unknown
14-
ARG DATE=unknown
15-
16-
RUN CGO_ENABLED=0 go build \
17-
-ldflags "-s -w \
18-
-X github.com/nficano/github-runner/internal/version.Version=${VERSION} \
19-
-X github.com/nficano/github-runner/internal/version.Commit=${COMMIT} \
20-
-X github.com/nficano/github-runner/internal/version.Date=${DATE}" \
21-
-o /github-runner ./cmd/github-runner
22-
231
FROM alpine:3.19
242

253
RUN apk add --no-cache \
@@ -31,7 +9,7 @@ RUN apk add --no-cache \
319
&& addgroup -S runner \
3210
&& adduser -S runner -G runner
3311

34-
COPY --from=builder /github-runner /usr/local/bin/github-runner
12+
COPY github-runner /usr/local/bin/github-runner
3513

3614
RUN mkdir -p /etc/github-runner /var/lib/github-runner /var/log/github-runner \
3715
&& chown -R runner:runner /var/lib/github-runner /var/log/github-runner

0 commit comments

Comments
 (0)