-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (35 loc) · 955 Bytes
/
Dockerfile
File metadata and controls
42 lines (35 loc) · 955 Bytes
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
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
# Update the system and install dependencies
RUN apt-get update && apt-get install -y \
ca-certificates \
curl \
build-essential \
pkg-config \
libpcap-dev \
iproute2 \
&& rm -rf /var/lib/apt/lists/*
# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& . $HOME/.cargo/env \
&& rustup install stable \
&& rustup toolchain install nightly --component rust-src \
&& cargo install bpf-linker
ENV PATH="/root/.cargo/bin:${PATH}"
ENV RUST_LOG=info
# Copy
WORKDIR /usr/src/app
COPY Cargo.toml ./
COPY .cargo ./.cargo
COPY common ./common
COPY rustiflow ./rustiflow
COPY xtask ./xtask
COPY rustfmt.toml .
COPY ebpf-ipv4 ./ebpf-ipv4
COPY ebpf-ipv6 ./ebpf-ipv6
# Build
RUN cargo xtask ebpf-ipv4 --release
RUN cargo xtask ebpf-ipv6 --release
RUN cargo build --release
# Command
ENTRYPOINT ["/usr/src/app/target/release/rustiflow"]