Merge pull request #53992 from thaJeztah/build_tags
hack, Dockerfile: adjust some build-tags to slightly reduce binary sizes
This commit is contained in:
2 files changed
+7
-3
No files matched your search
+2
-2
@@ -170,7 +170,7 @@ RUN --mount=from=containerd-src,src=/usr/src/containerd,rw \
|
||||
|
||||
set -x
|
||||
xx-go --wrap
|
||||
CC="$(xx-info)-gcc" CGO_ENABLED=$cgo_enabled make $make_flags binaries
|
||||
CC="$(xx-info)-gcc" CGO_ENABLED=$cgo_enabled make $make_flags BUILDTAGS=grpcnotrace binaries
|
||||
xx-verify $verify_flags bin/containerd
|
||||
xx-verify $verify_flags bin/containerd-shim-runc-v2
|
||||
xx-verify $verify_flags bin/ctr
|
||||
@@ -350,7 +350,7 @@ RUN --mount=from=rootlesskit-src,src=/usr/src/rootlesskit,rw \
|
||||
if [ "$DOCKER_STATIC" = "1" ]; then
|
||||
set -x
|
||||
export CGO_ENABLED=0
|
||||
xx-go build -o /build/rootlesskit ./cmd/rootlesskit
|
||||
xx-go build -tags=urfave_cli_no_docs -o /build/rootlesskit ./cmd/rootlesskit
|
||||
xx-verify --static /build/rootlesskit
|
||||
else
|
||||
set -x
|
||||
|
||||
+5
-1
@@ -88,7 +88,11 @@ if [ -z "$DOCKER_DEBUG" ]; then
|
||||
LDFLAGS='-w'
|
||||
fi
|
||||
|
||||
BUILDFLAGS=(${BUILDFLAGS} -tags "netgo osusergo static_build nri_no_wasm $DOCKER_BUILDTAGS")
|
||||
# grpcnotrace avoids importing golang.org/x/net/trace, which in turn enables
|
||||
# dead code elimination, which can reduce binary size when tracing is not needed.
|
||||
#
|
||||
# see https://github.com/grpc/grpc-go/blob/v1.83.2/trace_notrace.go#L23-L25
|
||||
BUILDFLAGS=(${BUILDFLAGS} -tags "grpcnotrace netgo osusergo static_build nri_no_wasm $DOCKER_BUILDTAGS")
|
||||
LDFLAGS_STATIC="-extldflags -static"
|
||||
|
||||
if [ "$(uname -s)" = 'FreeBSD' ]; then
|
||||
|
||||
Reference in new issue
Block a user