Skip to content

Commit 3383d95

Browse files
committed
dockerfile static
1 parent b212a02 commit 3383d95

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ Next-Generation [HEP](https://github.com/sipcapture/hep) Capture Agent in Rust
1515
#### Build
1616
* Run `cargo build --release`
1717

18+
#### Docker Build
19+
* Dynamic
20+
`docker build -t sipcapture/hepagent -f docker/Dockerfile .`
21+
* Static _(work in progress)_
22+
`docker build -t sipcapture/hepagent-static -f docker/Dockerfile-static .`
23+
1824
---------
1925

2026
#### Developers

docker/Dockerfile-static

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
FROM ekidd/rust-musl-builder:latest AS builder
22
WORKDIR /home/rust/src
33
ADD --chown=rust:rust . ./
4-
RUN sudo apt update && sudo apt install -y libluajit-5.1-dev libpcap-dev \
5-
&& cargo build --release
4+
5+
RUN sudo apt update && sudo apt install -y flex bison
6+
7+
RUN LIBPCAP_VERSION=1.8.1 && \
8+
cd /home/rust/libs && \
9+
curl -LO http://www.tcpdump.org/release/libpcap-${LIBPCAP_VERSION}.tar.gz && \
10+
tar xzvf libpcap-${LIBPCAP_VERSION}.tar.gz && cd libpcap-${LIBPCAP_VERSION} && \
11+
CC='musl-gcc -static -fPIC' LD=musl-ld ./configure --disable-shared && \
12+
make -j4 && sudo make install && \
13+
cd .. && rm -rf libpcap-${LIBPCAP_VERSION}*
14+
15+
RUN cargo build --release
616

717

818
FROM alpine:latest

0 commit comments

Comments
 (0)