forked from bpfman/bpfman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerfile.bpfman.local
52 lines (39 loc) · 1.75 KB
/
Containerfile.bpfman.local
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
52
## This Containerfile makes use of docker's Buildkit to cache crates between
## builds, dramatically speeding up the local development process.
# Move to Ubunutu 24.04 to track how images are built in github and Containerfile.bpfman.multi.arch.
# This is a short term fix and will be moving to ubi9minimal as soon as possible. So try to keep
# keep Ubuntu specifics on their own lines.
#FROM rust:1 AS bpfman-build
FROM ubuntu:24.04 AS bpfman-build
# Packages need to build on Ubuntu
RUN apt-get update && apt-get install -y\
pkg-config\
curl
RUN apt-get update && apt-get install -y\
gcc-multilib\
libssl-dev
# Get Rust for Ubuntu base build
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH=/root/.cargo/bin:$PATH
WORKDIR /usr/src/bpfman
COPY ./ /usr/src/bpfman
# Compile bpfman cli, bpfman-ns, and bpfman-rpc binaries
RUN --mount=type=cache,target=/usr/src/bpfman/target/ \
--mount=type=cache,target=/usr/local/cargo/registry \
cargo build --release
RUN --mount=type=cache,target=/usr/src/bpfman/target/ \
cp /usr/src/bpfman/target/release/bpfman ./bpfman/
RUN --mount=type=cache,target=/usr/src/bpfman/target/ \
cp /usr/src/bpfman/target/release/bpfman-ns ./bpfman/
RUN --mount=type=cache,target=/usr/src/bpfman/target/ \
cp /usr/src/bpfman/target/release/bpfman-rpc ./bpfman/
#FROM fedora:40
FROM ubuntu:24.04
## Image for Local testing is much more of a debug image, give it bpftool and tcpdump
# RUN dnf makecache --refresh && dnf -y install bpftool tcpdump
RUN apt-get update && \
apt-get -y install linux-tools-common tcpdump ca-certificates && \
apt-get clean && \
rm -rf /var/lib/apt/lists/\* /tmp/\* /var/tmp/*
COPY --from=bpfman-build ./usr/src/bpfman/bpfman .
ENTRYPOINT ["./bpfman-rpc", "--timeout=0"]