Skip to content

Commit

Permalink
Containerfile: make image smaller
Browse files Browse the repository at this point in the history
by omitting unnecessary debug info.

$ go tool link
...
  -s	disable symbol table
...
  -w	disable DWARF generation
$
  • Loading branch information
Al2Klimov committed Jun 3, 2024
1 parent 6357a12 commit 513e8fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COPY go.mod go.sum ./
RUN go mod download

COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o /icinga-kubernetes cmd/icinga-kubernetes/main.go
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags '-s -w' -o /icinga-kubernetes cmd/icinga-kubernetes/main.go

FROM scratch

Expand Down

0 comments on commit 513e8fe

Please sign in to comment.