Skip to content

Commit 6c111b4

Browse files
committed
chore: install last version of golang
1 parent 1085fc5 commit 6c111b4

File tree

2 files changed

+34
-9
lines changed

2 files changed

+34
-9
lines changed

builder/Dockerfile.alpine-tracee-container

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
ARG BTFHUB=0
66
ARG 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
2634
RUN 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

86105
RUN cd /tmp && \
@@ -101,7 +120,8 @@ WORKDIR /tracee
101120

102121
COPY . /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 && \

builder/Dockerfile.ubuntu-tracee-make

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ FROM ubuntu:jammy
77
ARG uid=1000
88
ARG gid=1000
99

10+
#
11+
# Version
12+
#
13+
14+
ARG GO_VERSION=1.22.0
15+
ARG OPA_VERSION=v0.63.0
16+
1017
# install needed environment
1118

1219
RUN export DEBIAN_FRONTEND=noninteractive && \
@@ -30,9 +37,8 @@ RUN cd /tmp && \
3037
./3rdparty/bpftool.sh
3138

3239
# install OPA
33-
3440
RUN altarch=$(uname -m | sed 's:x86_64:amd64:g' | sed 's:aarch64:arm64:g') && \
35-
curl -L -o /usr/bin/opa https://github.com/open-policy-agent/opa/releases/download/v0.63.0/opa_linux_${altarch}_static && \
41+
curl -L -o /usr/bin/opa https://github.com/open-policy-agent/opa/releases/download/${OPA_VERSION}/opa_linux_${altarch}_static && \
3642
chmod 755 /usr/bin/opa
3743

3844
# extra tools for testing things
@@ -66,12 +72,11 @@ RUN export uid=$uid gid=$gid && \
6672
ln -s /home/tracee/.bashrc /home/tracee/.profile
6773

6874
# install extra packages (if needed)
69-
7075
RUN export DEBIAN_FRONTEND=noninteractive && \
7176
altarch=$(uname -m | sed 's:x86_64:amd64:g' | sed 's:aarch64:arm64:g') && \
7277
apt-get update && \
73-
curl -L -o /tmp/golang.tar.xz https://go.dev/dl/go1.22.3.linux-${altarch}.tar.gz && \
74-
tar -C /usr/local -xzf /tmp/golang.tar.xz && \
78+
curl -L -o go${GO_VERSION}.linux-${altarch}.tar.gz https://go.dev/dl/go${GO_VERSION}.linux-${altarch}.tar.gz && \
79+
tar -C /usr/local -xzf go${GO_VERSION}.linux-${altarch}.tar.gz && \
7580
update-alternatives --install /usr/bin/go go /usr/local/go/bin/go 1 && \
7681
update-alternatives --install /usr/bin/gofmt gofmt /usr/local/go/bin/gofmt 1
7782

0 commit comments

Comments
 (0)