Skip to content

Commit 0e82df7

Browse files
authored
Merge pull request #869 from marquiz/backports/release-0.7
[release 0.7] backport image building fixes
2 parents d8c1dd8 + 6ca24d4 commit 0e82df7

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,10 @@ libexec/%.o: elf/%.c
276276
$(Q)$(CLANG) -nostdinc -D __KERNEL__ $(KERNEL_INCLUDES) -O2 -Wall -target bpf -c $< -o $@
277277

278278
bin/%: .static.%.$(STATIC)
279-
$(Q)bin=$(notdir $@); src=cmd/$$bin; \
279+
$(Q)bin=$(notdir $@); src=./cmd/$$bin; \
280280
echo "Building $$([ -n "$(STATIC)" ] && echo 'static ')$@ (version $(BUILD_VERSION), build $(BUILD_BUILDID))..."; \
281281
mkdir -p bin && \
282-
cd $$src && \
283-
$(GO_BUILD) $(BUILD_TAGS) $(LDFLAGS) $(GCFLAGS) -o ../../bin/$$bin
282+
$(GO_BUILD) $(BUILD_TAGS) $(LDFLAGS) $(GCFLAGS) -o bin/ $$src
284283

285284
.static.%.$(STATIC):
286285
$(Q)if [ ! -f "$@" ]; then \

cmd/cri-resmgr-agent/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RUN go mod download
1212
# Build webhook, fully statically linked binary
1313
COPY . .
1414

15-
RUN CGO_ENABLED=0 make BUILD_DIRS="cri-resmgr-agent cri-resmgr-agent-probe"
15+
RUN CGO_ENABLED=0 make build-static BUILD_DIRS="cri-resmgr-agent cri-resmgr-agent-probe"
1616

1717
FROM scratch as final
1818

cmd/cri-resmgr-webhook/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RUN go mod download
1212
# Build webhook, fully statically linked binary
1313
COPY . .
1414

15-
RUN CGO_ENABLED=0 make BUILD_DIRS=cri-resmgr-webhook
15+
RUN CGO_ENABLED=0 make build-static BUILD_DIRS=cri-resmgr-webhook
1616

1717
FROM scratch as final
1818

0 commit comments

Comments
 (0)