-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdeb.dockerfile
38 lines (31 loc) · 1.22 KB
/
deb.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
ARG build_image
FROM $build_image AS build-stage
RUN apt-get update && apt-get install bzip2 --yes
# build static libmnl
WORKDIR /tmp/libmnl
RUN curl -sL https://www.netfilter.org/pub/libmnl/libmnl-1.0.5.tar.bz2 | tar jx --strip-components=1 && \
./configure --enable-static --disable-shared --prefix=/usr && \
make -j CFLAGS="-fPIE -O3" && \
make install
# build static libnftnl
WORKDIR /tmp/libnftnl
RUN curl -sL https://www.netfilter.org/pub/libnftnl/libnftnl-1.2.3.tar.bz2 | tar jx --strip-components=1 && \
./configure --enable-static --disable-shared --prefix=/usr && \
make -j CFLAGS="-fPIE -O3" && \
make install
# build static nftables
WORKDIR /tmp/nftables
RUN curl -sL https://www.netfilter.org/pub/nftables/nftables-1.0.5.tar.bz2 | tar jx --strip-components=1 && \
./configure --enable-static --disable-shared --with-mini-gmp --without-cli --prefix=/usr --disable-python && \
make -j CFLAGS="-fPIE -O3" && \
make install
WORKDIR /tmp/sparoid
# Copy all files
COPY shard.yml shard.lock README.md LICENSE ./
COPY src src
COPY build build
# Build deb package
RUN build/deb
# Copy the deb package to a scratch image, that then can be exported
FROM scratch AS export-stage
COPY --from=build-stage /tmp/sparoid/builds .