@@ -10,7 +10,7 @@ IMAGE_PUSH_CMD ?= docker push
10
10
CONTAINER_RUN_CMD ?= docker run
11
11
BUILDER_IMAGE ?= golang:1.20-bullseye
12
12
BASE_IMAGE_FULL ?= debian:bullseye-slim
13
- BASE_IMAGE_MINIMAL ?= gcr.io/distroless/base
13
+ BASE_IMAGE_MINIMAL ?= scratch
14
14
15
15
# Docker base command for working with html documentation.
16
16
# Use host networking because 'jekyll serve' is stupid enough to use the
@@ -57,7 +57,8 @@ KUBECONFIG ?= ${HOME}/.kube/config
57
57
E2E_TEST_CONFIG ?=
58
58
E2E_PULL_IF_NOT_PRESENT ?= false
59
59
60
- LDFLAGS = -ldflags "-s -w -X sigs.k8s.io/node-feature-discovery/pkg/version.version=$(VERSION ) -X sigs.k8s.io/node-feature-discovery/pkg/utils/hostpath.pathPrefix=$(HOSTMOUNT_PREFIX ) "
60
+ BUILD_FLAGS = -tags osusergo,netgo \
61
+ -ldflags "-s -w -extldflags=-static -X sigs.k8s.io/node-feature-discovery/pkg/version.version=$(VERSION ) -X sigs.k8s.io/node-feature-discovery/pkg/utils/hostpath.pathPrefix=$(HOSTMOUNT_PREFIX ) "
61
62
62
63
# multi-arch build with buildx
63
64
IMAGE_ALL_PLATFORMS ?= linux/amd64,linux/arm64
@@ -89,10 +90,10 @@ all: image
89
90
90
91
build :
91
92
@mkdir -p bin
92
- $(GO_CMD ) build -v -o bin $(LDFLAGS ) ./cmd/...
93
+ $(GO_CMD ) build -v -o bin $(BUILD_FLAGS ) ./cmd/...
93
94
94
95
install :
95
- $(GO_CMD ) install -v $(LDFLAGS ) ./cmd/...
96
+ $(GO_CMD ) install -v $(BUILD_FLAGS ) ./cmd/...
96
97
97
98
image : yamls
98
99
$(IMAGE_BUILD_CMD ) $(IMAGE_BUILD_ARGS ) $(IMAGE_BUILD_ARGS_FULL )
0 commit comments