diff --git a/Makefile b/Makefile index 52682575..7d918152 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,8 @@ IMAGE_INITCONTAINER_LATEST := $(IMAGE_NAME_INIT):latest IMAGE_BUILD_FLAGS ?= "--no-cache" +BPFTRACEVERSION ?= "0.9.2-1" + LDFLAGS := -ldflags '-X github.com/iovisor/kubectl-trace/pkg/version.buildTime=$(shell date +%s) -X github.com/iovisor/kubectl-trace/pkg/version.gitCommit=${GIT_COMMIT} -X github.com/iovisor/kubectl-trace/pkg/cmd.ImageNameTag=${IMAGE_TRACERUNNER_COMMIT} -X github.com/iovisor/kubectl-trace/pkg/cmd.InitImageNameTag=${IMAGE_INITCONTAINER_COMMIT}' TESTPACKAGES := $(shell go list ./... | grep -v github.com/iovisor/kubectl-trace/integration) @@ -50,6 +52,7 @@ image/build-init: .PHONY: image/build image/build: $(DOCKER) build \ + --build-arg bpftraceversion=$(BPFTRACEVERSION) \ $(IMAGE_BUILD_FLAGS) \ -t "$(IMAGE_TRACERUNNER_BRANCH)" \ -f build/Dockerfile.tracerunner . diff --git a/build/Dockerfile.tracerunner b/build/Dockerfile.tracerunner index ca2f63a8..cd5b9966 100644 --- a/build/Dockerfile.tracerunner +++ b/build/Dockerfile.tracerunner @@ -9,9 +9,9 @@ WORKDIR /go/src/github.com/iovisor/kubectl-trace RUN make _output/bin/trace-runner FROM ubuntu:19.10 - -RUN apt-get update && apt-get install -y bpftrace && \ - rm -rf /var/lib/apt/lists/* && apt-get clean +ARG bpftraceversion=0.9.2-1 +RUN apt-get update && apt-get install -y bpftrace=${bpftraceversion} && \ + rm -rf /var/lib/apt/lists/* && apt-get clean COPY --from=gobuilder /go/src/github.com/iovisor/kubectl-trace/_output/bin/trace-runner /bin/trace-runner