Skip to content

Commit

Permalink
new(build): make sure we only build with the specified bpftrace version
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenzo Fontana <[email protected]>
  • Loading branch information
fntlnz authored and leodido committed Aug 31, 2019
1 parent 9582b4f commit fdb48c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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 .
Expand Down
6 changes: 3 additions & 3 deletions build/Dockerfile.tracerunner
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit fdb48c8

Please sign in to comment.