Skip to content

Commit 68e3178

Browse files
committed
dist.sh: use go build option to strip binaries
30% release binary size reduction
1 parent d7e327d commit 68e3178

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dist.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ for os in windows linux darwin; do
2525
fi
2626
BUILD=$(mktemp -d ${TMPDIR:-/tmp}/oauth2_proxy.XXXXXX)
2727
TARGET="oauth2_proxy-$version.$os-$arch.$goversion"
28-
GOOS=$os GOARCH=$arch CGO_ENABLED=0 go build -o $BUILD/$TARGET/oauth2_proxy$EXT || exit 1
28+
GOOS=$os GOARCH=$arch CGO_ENABLED=0 \
29+
go build -ldflags="-s -w" -o $BUILD/$TARGET/oauth2_proxy$EXT || exit 1
2930
pushd $BUILD
3031
tar czvf $TARGET.tar.gz $TARGET
3132
mv $TARGET.tar.gz $DIR/dist

0 commit comments

Comments
 (0)