Skip to content

Commit fd728f0

Browse files
btfhub: fix tracee container image with btfhub (aquasecurity#3095)
Currently, after the single binary was added to the official container image, I believe BTFHUB support has not been included in the binaries of the docker images. This needs fixing asap as this is what allows tracee to be fully portable. This is an important fix if you want to run tracee in older kernels.
1 parent 5d64064 commit fd728f0

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

.dockerignore

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
./dist/*
2-
./3rdparty/btfhub
3-
./3rdparty/btfhub/*
4-
./3rdparty/btfhub-archive
5-
./3rdparty/btfhub-archive/*
6-
./tests/distro-tester/*
1+
dist/*
2+
3rdparty/btfhub
3+
3rdparty/btfhub/*
4+
3rdparty/btfhub-archive
5+
3rdparty/btfhub-archive/*
6+
tests/distro-tester/*

builder/Dockerfile.alpine-tracee-container

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ WORKDIR /tracee
6363
COPY . /tracee
6464

6565
RUN make clean && \
66+
BTFHUB=$BTFHUB make tracee && \
6667
BTFHUB=$BTFHUB make tracee-ebpf && \
6768
make tracee-rules && \
6869
make signatures && \
69-
make tracee && \
7070
rm -rf ./3rdparty/btfhub/ && \
7171
rm -rf ./3rdparty/btfhub-archive/
7272

pkg/cmd/initialize/bpfobject.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ func BpfObject(config *tracee.Config, kConfig *helpers.KernelConfig, osInfo *hel
4343
if err == nil {
4444
logger.Debugw("BTF: btfhub embedded BTF file", "file", unpackBTFFile)
4545
config.BTFObjPath = unpackBTFFile
46+
} else {
47+
logger.Debugw("BTF: error unpacking embedded BTFHUB file", "error", err)
4648
}
4749
}
4850

0 commit comments

Comments
 (0)