-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
51 lines (42 loc) · 956 Bytes
/
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
# Minimal Base Image
FROM golang:1.22.4 AS builder
WORKDIR /workspace
# Install required dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
clang \
git \
libbpf-dev \
libseccomp-dev \
build-essential \
bpftool \
ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Copy the required file to build the application
COPY cmd/ cmd/
COPY ebpf/ ebpf/
COPY internal/ internal/
COPY main.go main.go
COPY go.mod go.mod
COPY go.sum go.sum
COPY Makefile Makefile
# Build harpoon
RUN make build
# Final stage
FROM debian:bookworm-slim
WORKDIR /
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libelf1 && \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /workspace/bin/harpoon .
# run it with the following command:
# docker run \
# -it \
# --rm \
# --privileged \
# --net=host \
# --pid=host \
# -v /sys/kernel/debug/:/sys/kernel/debug:rw \
# harpoon:latest
ENTRYPOINT ["/bin/bash"]