forked from deepfence/PacketStreamer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (30 loc) · 778 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
FROM alpine:3.15 as builder
RUN apk update \
&& apk add \
bison \
build-base \
ca-certificates \
flex \
git \
go \
linux-headers \
make
RUN git clone --branch libpcap-1.10.1 --depth 1 https://github.com/the-tcpdump-group/libpcap.git /libpcap \
&& cd /libpcap \
&& ./configure \
--disable-shared \
--disable-usb \
--disable-netmap \
--disable-bluetooth \
--disable-dbus \
--disable-rdma \
&& make -j $(nproc) \
&& make install
COPY . /src
WORKDIR /src
ARG RELEASE=0
RUN --mount=type=cache,target=/root/.cache/go-build \
make build STATIC=1 RELEASE=${RELEASE}
FROM alpine:3.15 as packetstreamer
COPY --from=builder /src/packetstreamer /usr/bin/packetstreamer
ENTRYPOINT ["/usr/bin/packetstreamer"]