-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
45 lines (35 loc) · 1.31 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#
# Build Image
#
FROM ubuntu:22.04 AS build
ENV GO_VERSION=1.23.0
# Build dependencies:
RUN apt update -y
RUN apt install -y clang libelf1 libelf-dev zlib1g-dev make build-essential libz-dev libcap-dev llvm llvm-dev lld binutils-dev pkg-config linux-tools-generic wget binutils git libssl-dev protobuf-compiler gcc
# Debugging tools:
# RUN apt install -y curl net-tools iproute2 dnsutils strace ltrace
# RUN apt install -y python3-pip ruby
# RUN pip3 install requests
# Install Go
RUN export ARCH=$(dpkg --print-architecture) \
&& wget -q https://go.dev/dl/go${GO_VERSION}.linux-${ARCH}.tar.gz -O /tmp/go.tar.gz \
&& tar -C /usr/local -xf /tmp/go.tar.gz
ENV PATH="$PATH:/usr/local/go/bin:/root/go/bin"
# Go Build dependencies
RUN go install github.com/shuLhan/go-bindata/cmd/go-bindata@latest
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
RUN go install github.com/onsi/ginkgo/v2/ginkgo@v2.12.0
RUN echo "PS1='${debian_chroot:+($debian_chroot)}\[\033[01;35m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$'" >> ~/.bashrc
WORKDIR /app
ADD . /app
RUN make install-libbpf
RUN make
RUN make testunit
#
# Final Image
#
FROM alpine:latest AS final
WORKDIR /app
COPY --from=build /app/trayce_agent /app/trayce_agent
ENTRYPOINT ["./trayce_agent"]