Skip to content

Commit 439da9e

Browse files
authored
Speed up label checking by making binary smaller (#65)
This commit removes the DWARF debugging information[1], resulting in the Docker image size shrinking from 4.76MB to 2.88MB. Decided not to try to also turn off generation of the Go symbol table using the `-s` flag, as: 1. the GOFLAGS functionality currently only allows 1 ldflag to be set[2] (NB this may be fixed in Go 1.15[3]) 2. The improvements to the binary size in Go 1.15 [4] mean that the `-s` flag will no longer really do anything[5] Will also try shrinking the binary size further using upx[6] in a separate pull request. [1] https://stackoverflow.com/a/22276273 [2] golang/go#38522 [3] golang/go#26849 (comment) [4] See #64 [5] https://twitter.com/bradfitz/status/1256989624590712834 [6] https://upx.github.io/
1 parent ada4109 commit 439da9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ COPY . .
55

66
RUN scripts/install-mage.sh
77

8-
RUN CGO_ENABLED=0 mage -compile /bin/check-labels -goos linux -goarch amd64
8+
RUN CGO_ENABLED=0 GOFLAGS=-ldflags="-w" mage -compile /bin/check-labels -goos linux -goarch amd64
99

1010

1111
# Use the most basic and empty container - this container has no

0 commit comments

Comments
 (0)