-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
83 lines (67 loc) · 1.65 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# SPDX-FileCopyrightText: 2024 Tobias Böhm <[email protected]>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# syntax=docker/dockerfile:1
ARG KERNEL_VERSION=6.6
FROM alpine:3.20 AS go-image
RUN --mount=type=cache,target=/var/cache/apk \
apk add \
go \
make
# Build:
# podman build --rm --tag exceed2go-build --target build-image .
#
# Run:
# podman run --rm \
# --volume $PWD:/data \
# exceed2go-build:latest
#
FROM go-image AS build-image
WORKDIR /tmp/download
ADD go.mod go.sum ./
RUN go mod download -x
VOLUME /data
WORKDIR /data
CMD make build
# Build:
# podman build --rm --tag exceed2go-build-bpf --target build-bpf-image .
#
# Run:
# podman run --rm \
# --volume $PWD:/data \
# exceed2go-build-bpf:latest
#
FROM build-image AS build-bpf-image
ARG LLVM_VERSION=17
RUN --mount=type=cache,target=/var/cache/apk \
apk add \
"clang${LLVM_VERSION}" \
"llvm${LLVM_VERSION}"
CMD make bpf
# Build:
# podman build --rm --tag exceed2go-test --target test-image .
#
# Run:
# podman run --rm \
# --volume $PWD:/data \
# --device /dev/kvm \
# exceed2go-test:latest
#
# Run with different kernel:
# podman run --rm \
# --volume $PWD:/data \
# --mount type=image,source=ghcr.io/cilium/ci-kernels:6.7,destination=/k \
# --device /dev/kvm \
# --env KERNEL=/k/boot/vmlinuz \
# exceed2go-test:latest
#
FROM ghcr.io/cilium/ci-kernels:${KERNEL_VERSION} AS test-kernel
FROM build-image AS test-image
RUN --mount=type=cache,target=/var/cache/apk \
apk add \
qemu-system-x86_64
COPY --from=test-kernel /boot/vmlinuz /vmlinuz
ENV KERNEL=/vmlinuz
CMD make pidonetest PIDONETEST_KERNEL=${KERNEL}
FROM build-image