forked from bpfman/bpfman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Containerfile.bpfman.multi.arch
43 lines (35 loc) · 1.8 KB
/
Containerfile.bpfman.multi.arch
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
# We do not use --platform feature to auto fill this ARG because of incompatibility between podman and docker
ARG BUILDPLATFORM=linux/amd64
FROM --platform=$BUILDPLATFORM redhat/ubi9-minimal AS bpfman-build
ARG BUILDPLATFORM
# The following ARGs are set internally by docker/build-push-action in github actions
ARG TARGETPLATFORM
WORKDIR /usr/src/bpfman
COPY ./ /usr/src/bpfman
RUN mkdir -p bin/
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
echo "Building x86" && \
cp target/x86_64-unknown-linux-gnu/release/bpfman bin/. && \
cp target/x86_64-unknown-linux-gnu/release/bpfman-ns bin/. && \
cp target/x86_64-unknown-linux-gnu/release/bpfman-rpc bin/.; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
echo "Building arm64" && \
cp target/aarch64-unknown-linux-gnu/release/bpfman bin/. && \
cp target/aarch64-unknown-linux-gnu/release/bpfman-ns bin/. && \
cp target/aarch64-unknown-linux-gnu/release/bpfman-rpc bin/.; \
elif [ "$TARGETPLATFORM" = "linux/ppc64le" ]; then \
echo "Building ppc64le" && \
cp target/powerpc64le-unknown-linux-gnu/release/bpfman bin/. && \
cp target/powerpc64le-unknown-linux-gnu/release/bpfman-ns bin/. && \
cp target/powerpc64le-unknown-linux-gnu/release/bpfman-rpc bin/.; \
elif [ "$TARGETPLATFORM" = "linux/s390x" ]; then \
echo "Building s390x" && \
cp target/s390x-unknown-linux-gnu/release/bpfman bin/. && \
cp target/s390x-unknown-linux-gnu/release/bpfman-ns bin/. && \
cp target/s390x-unknown-linux-gnu/release/bpfman-rpc bin/.; \
fi
FROM redhat/ubi9-minimal
COPY --from=bpfman-build /usr/src/bpfman/bin/bpfman .
COPY --from=bpfman-build /usr/src/bpfman/bin/bpfman-ns .
COPY --from=bpfman-build /usr/src/bpfman/bin/bpfman-rpc .
ENTRYPOINT ["./bpfman-rpc", "--timeout=0"]