@@ -64,6 +64,7 @@ CGO_ENABLED:=0
64
64
65
65
# Construct the "-tags" parameter used by "go build".
66
66
BUILD_TAGS? =
67
+
67
68
ifeq ($(ENABLE_JOURNALD ) , 1)
68
69
# Enable journald build tag.
69
70
BUILD_TAGS:=$(BUILD_TAGS) journald
@@ -73,6 +74,11 @@ ifeq ($(ENABLE_JOURNALD), 1)
73
74
# here, because go-systemd uses dlopen, and dlopen will not work properly in a
74
75
# statically linked application.
75
76
CGO_ENABLED:=1
77
+ LOGCOUNTER=./bin/log-counter
78
+ else
79
+ # Hack: Don't copy over log-counter, use a wildcard path that shouldnt match
80
+ # anything in COPY command.
81
+ LOGCOUNTER=*dont-include-log-counter
76
82
endif
77
83
78
84
vet :
@@ -175,14 +181,6 @@ endif
175
181
-tags " $( BUILD_TAGS) " \
176
182
cmd/healthchecker/health_checker.go
177
183
178
- Dockerfile : Dockerfile.in
179
- sed -e ' s|@BASEIMAGE@|$(BASEIMAGE)|g' $< > $@
180
- ifneq ($(ENABLE_JOURNALD ) , 1)
181
- sed -i '/Below command depends on ENABLE_JOURNAL=1/,+2d' $@
182
- echo "Warning: log-counter requires journald, skipping."
183
- endif
184
-
185
-
186
184
test : vet fmt
187
185
GO111MODULE=on go test -mod vendor -timeout=1m -v -race -short -tags " $( BUILD_TAGS) " ./...
188
186
@@ -199,7 +197,7 @@ e2e-test: vet fmt build-tar
199
197
build-binaries : ./bin/node-problem-detector ./bin/log-counter ./bin/health-checker
200
198
201
199
build-container : build-binaries Dockerfile
202
- docker build -t $(IMAGE ) .
200
+ docker build -t $(IMAGE ) --build-arg BASEIMAGE= $( BASEIMAGE ) --build-arg LOGCOUNTER= $( LOGCOUNTER ) .
203
201
204
202
build-tar : ./bin/node-problem-detector ./bin/log-counter ./bin/health-checker ./test/bin/problem-maker
205
203
tar -zcvf $(TARBALL ) bin/ config/ test/e2e-install.sh test/bin/problem-maker
0 commit comments