Skip to content

Commit f31d5a3

Browse files
committed
build(docker): drop no-op build flags and use an allowlist ignore
1 parent 1d4a725 commit f31d5a3

2 files changed

Lines changed: 11 additions & 25 deletions

File tree

.dockerignore

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,8 @@
1-
.DS_Store
2-
.env
3-
.env.*
4-
.git
5-
.gitattributes
6-
.github
7-
.gitignore
8-
.goreleaser.yml
9-
*_test.go
10-
*.dll
11-
*.dylib
12-
*.exe
13-
*.gif
14-
*.log
15-
*.md
16-
*.so
17-
*.tape
18-
bin/
19-
dist/
20-
ffrelayctl
21-
LICENSE
22-
Thumbs.db
1+
*
2+
!go.mod
3+
!go.sum
4+
!main.go
5+
!api
6+
!cmd
7+
!output
8+
**/*_test.go

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ FROM golang:1.27-alpine AS builder
22

33
WORKDIR /build
44

5+
ARG VERSION=dev
6+
57
COPY go.mod go.sum ./
68
RUN go mod download && go mod verify
79

810
COPY . .
911

1012
RUN CGO_ENABLED=0 GOOS=linux go build \
11-
-a \
12-
-installsuffix cgo \
13-
-ldflags='-w -s -extldflags "-static"' \
1413
-trimpath \
14+
-ldflags="-s -w -X main.version=${VERSION}" \
1515
-o ffrelayctl .
1616

1717
FROM gcr.io/distroless/static:nonroot

0 commit comments

Comments
 (0)