mirror of
https://github.com/cnrancher/kube-explorer.git
synced 2026-01-25 15:05:56 +00:00
Compress binary more
This commit is contained in:
@@ -14,18 +14,13 @@ LD_INJECT_VALUES="-X github.com/rancher/steve/pkg/version.Version=$VERSION
|
||||
|
||||
pushd $GIT_SOURCE
|
||||
|
||||
CGO_ENABLED=0 go build -tags embed \
|
||||
-ldflags \
|
||||
"$LD_INJECT_VALUES $LINKFLAGS" \
|
||||
-o bin/kube-explorer
|
||||
|
||||
if [ -n "$CROSS" ]; then
|
||||
for ARCH in ${OS_ARCH_ARG_LINUX}; do
|
||||
OUTPUT_BIN="bin/kube-explorer-linux-$ARCH"
|
||||
echo "Building binary for linux/$ARCH..."
|
||||
GOARCH=$ARCH GOOS=linux CGO_ENABLED=0 go build -tags embed \
|
||||
-ldflags \
|
||||
"$LD_INJECT_VALUES" \
|
||||
"$LD_INJECT_VALUES $LINKFLAGS" \
|
||||
-o ${OUTPUT_BIN}
|
||||
done
|
||||
|
||||
@@ -34,7 +29,7 @@ if [ -n "$CROSS" ]; then
|
||||
echo "Building binary for windows/$ARCH..."
|
||||
GOARCH=$ARCH GOOS=windows CGO_ENABLED=0 go build -tags embed \
|
||||
-ldflags \
|
||||
"$LD_INJECT_VALUES" \
|
||||
"$LD_INJECT_VALUES $LINKFLAGS" \
|
||||
-o ${OUTPUT_BIN}
|
||||
done
|
||||
|
||||
@@ -46,6 +41,12 @@ if [ -n "$CROSS" ]; then
|
||||
"$LD_INJECT_VALUES" \
|
||||
-o ${OUTPUT_BIN}
|
||||
done
|
||||
else
|
||||
# only build one for current platform
|
||||
CGO_ENABLED=0 go build -tags embed \
|
||||
-ldflags \
|
||||
"$LD_INJECT_VALUES $LINKFLAGS" \
|
||||
-o bin/kube-explorer
|
||||
fi
|
||||
|
||||
for f in $(ls ./bin/); do
|
||||
|
||||
@@ -5,7 +5,13 @@ source $(dirname $0)/version
|
||||
|
||||
pushd $DAPPER_SOURCE
|
||||
|
||||
cp bin/kube-explorer package/
|
||||
if [ -f bin/kube-explorer-linux-${ARCH} ]; then
|
||||
# For cross mode
|
||||
cp bin/kube-explorer-linux-${ARCH} package/kube-explorer
|
||||
else
|
||||
# For common mode
|
||||
cp bin/kube-explorer package/
|
||||
fi
|
||||
cd package
|
||||
docker build -f Dockerfile -t niusmallnan/kube-explorer:$VERSION .
|
||||
|
||||
|
||||
Reference in New Issue
Block a user