-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
65 lines (48 loc) · 1.23 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
## Build the backend
FROM golang:1.19-buster AS build-backend
WORKDIR /app
COPY go.mod ./
COPY go.sum ./
RUN go mod download
COPY *.go ./
RUN go build -o /backend
# Build the client
# C program with ncurses library needed
FROM gcc:latest AS build-client
WORKDIR /app
# Copy makefile and source code
COPY client/Makefile ./
COPY client/main.c ./
# Run make: lab binary will be created
RUN gcc -o /lab main.c -lncurses -pthread
## Nginx final base image
FROM nginx:latest
WORKDIR /
# Install packages
# clang llvm libelf-dev libpcap-dev gcc-multilib build-essential tcpdump ethtool socat traceroute iproute2 git iputils-ping
RUN apt-get update && apt-get install -y \
clang \
llvm \
libelf-dev \
libpcap-dev \
gcc-multilib \
build-essential \
tcpdump \
ethtool \
socat \
traceroute \
iproute2 \
git \
wget \
iputils-ping \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build-backend /backend /usr/local/bin/backend
COPY --from=build-client /lab /usr/local/bin/lab
# Copy ebpf folder
COPY eBPF_code .
# Set up ebpf program and maps
# --auto-mode: needed inside the docker
COPY docker_entrypoint /docker_entrypoint
RUN chmod +x /docker_entrypoint
EXPOSE 8080
ENTRYPOINT ["/docker_entrypoint"]