Skip to content

Commit

Permalink
Add Go build flags to decrease image size
Browse files Browse the repository at this point in the history
Add Go build flags to omit the symbols/debug tables to decrease the image size.

Signed-off-by: Matthias Diester <[email protected]>
  • Loading branch information
HeavyWombat committed Sep 8, 2022
1 parent 2d8ba7d commit 6d26fd2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helloworld/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM icr.io/codeengine/golang:alpine
COPY helloworld.go /
RUN go build -o /helloworld /helloworld.go
RUN go build -ldflags '-s -w -extldflags "-static"' -o /helloworld /helloworld.go

# Copy the exe into a smaller base image
FROM icr.io/codeengine/alpine
Expand Down

0 comments on commit 6d26fd2

Please sign in to comment.