Strip binaries to half of size

Signed-off-by: Alex Ellis <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis
2017-09-04 09:03:43 +01:00
parent 3db2064d91
commit cbfcbbb880

View File

@ -12,6 +12,7 @@ COPY types types
RUN go test
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o watchdog . \
&& GOARM=6 GOARCH=arm CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o watchdog-armhf . \
&& GOOS=windows CGO_ENABLED=0 go build -a -installsuffix cgo -o watchdog.exe .
# Stripping via -ldflags "-s -w"
RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags "-s -w" -installsuffix cgo -o watchdog . \
&& GOARM=6 GOARCH=arm CGO_ENABLED=0 GOOS=linux go build -a -ldflags "-s -w" -installsuffix cgo -o watchdog-armhf . \
&& GOOS=windows CGO_ENABLED=0 go build -a -ldflags "-s -w" -installsuffix cgo -o watchdog.exe .