55ARG BTFHUB=0
66ARG FLAVOR=tracee-ebpf-core
77
8+ #
9+ # Version
10+ #
11+
12+ ARG GO_VERSION=1.22.0
13+ ARG OPA_VERSION=v0.63.0
14+
15+
816#
917# tracee-base
1018#
@@ -22,9 +30,9 @@ RUN apk --no-cache update && \
2230 apk --no-cache add libc6-compat
2331
2432# install OPA
25-
33+ ARG OPA_VERSION
2634RUN altarch=$(uname -m | sed 's:x86_64:amd64:g' | sed 's:aarch64:arm64:g') && \
27- curl -L -o /usr/bin/opa https://github.com/open-policy-agent/opa/releases/download/v0.63.0 /opa_linux_${altarch}_static && \
35+ curl -L -o /usr/bin/opa https://github.com/open-policy-agent/opa/releases/download/${OPA_VERSION} /opa_linux_${altarch}_static && \
2836 chmod 755 /usr/bin/opa
2937
3038#
@@ -41,7 +49,7 @@ RUN apk --no-cache update && \
4149 apk --no-cache add bash git rsync && \
4250 apk --no-cache add coreutils findutils && \
4351 apk --no-cache add llvm14 clang14 && \
44- apk --no-cache add go make gcc && \
52+ apk --no-cache add make gcc && \
4553 apk --no-cache add musl-dev && \
4654 apk --no-cache add linux-headers && \
4755 apk --no-cache add elfutils-dev && \
@@ -81,6 +89,17 @@ RUN apk --no-cache update && \
8189 ln -s /usr/lib/llvm14/bin/llvm-readelf /usr/bin/llvm-readelf && \
8290 ln -s /usr/lib/llvm14/bin/opt /usr/bin/opt
8391
92+ # install GO
93+ ARG GO_VERSION
94+ RUN altarch=$(uname -m | sed 's:x86_64:amd64:g' | sed 's:aarch64:arm64:g') && \
95+ curl -L -o go${GO_VERSION}.linux-${altarch}.tar.gz https://go.dev/dl/go${GO_VERSION}.linux-${altarch}.tar.gz && \
96+ tar -C /usr/local -xzf go${GO_VERSION}.linux-${altarch}.tar.gz && \
97+ echo 'export PATH=$PATH:/usr/local/go/bin' >> /etc/profile && \
98+ echo 'export GOROOT=/usr/local/go' >> /etc/profile && \
99+ echo 'export GOPATH=$HOME/go' >> /etc/profile && \
100+ echo 'export GOTOOLCHAIN=auto' >> /etc/profile && \
101+ echo 'export PATH=$PATH:$GOPATH/bin' >> /etc/profile
102+
84103# install bpftool from btfhub
85104
86105RUN cd /tmp && \
@@ -101,7 +120,8 @@ WORKDIR /tracee
101120
102121COPY . /tracee
103122
104- RUN make clean && \
123+ RUN source /etc/profile && \
124+ make clean && \
105125 BTFHUB=$BTFHUB make tracee && \
106126 BTFHUB=$BTFHUB make tracee-ebpf && \
107127 make tracee-rules && \
0 commit comments