Skip to content

Commit

Permalink
pkg/bpftrace: push empty image to dockerhub
Browse files Browse the repository at this point in the history
this way we can work around the fact that get-deps does
not build dependencies architecture specific and therefore
tries to build bpftrace for riscv64
with this change an empty image will be pulled and put into
the debug container on riscv64

other architectures stay the same as before

Signed-off-by: Christoph Ostarek <christoph@zededa.com>
  • Loading branch information
christoph-zededa committed Jul 5, 2024
1 parent f208c67 commit c9a9a19
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ endif
PKGS_riscv64=pkg/ipxe pkg/mkconf pkg/mkimage-iso-efi pkg/grub \
pkg/mkimage-raw-efi pkg/uefi pkg/u-boot pkg/cross-compilers \
pkg/debug pkg/dom0-ztools pkg/gpt-tools pkg/storage-init pkg/mkrootfs-squash \
pkg/bsp-imx pkg/optee-os pkg/recovertpm
pkg/bsp-imx pkg/optee-os pkg/recovertpm pkg/bpftrace
# alpine-base and alpine must be the first packages to build
PKGS=pkg/alpine $(PKGS_$(ZARCH))
# eve-alpine-base is bootstrap image for eve-alpine
Expand Down
25 changes: 16 additions & 9 deletions pkg/bpftrace/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Copyright (c) 2024 Zededa, Inc.
# SPDX-License-Identifier: Apache-2.0
FROM lfedge/eve-alpine:1f7685f95a475c6bbe682f0b976f12180b6c8726 AS build
FROM lfedge/eve-alpine:1f7685f95a475c6bbe682f0b976f12180b6c8726 AS builder

ENV BUILD_PKGS make gcc g++ git perl linux-headers musl-dev cmake zlib-dev bcc-dev libbpf-dev cereal flex bison llvm13-libs llvm13-dev llvm13-static clang-dev clang-static pahole gtest-dev bash

Expand Down Expand Up @@ -30,11 +30,18 @@ RUN if perl -ne 'exit 1 if (m/^bogomips\s*:\s*(\d+)/i && $1 < 500);' /proc/cpuin
fi


FROM scratch
COPY --from=build /out/opt/zededa/usr/local/bin/bpftrace-aotrt /usr/bin/bpftrace-aotrt
COPY --from=build /usr/lib/libbpf.so.0 /usr/lib/libbpf.so.0
COPY --from=build /usr/lib/libelf.so.1 /usr/lib/libelf.so.1
COPY --from=build /lib/libz.so.1 /lib/libz.so.1
COPY --from=build /usr/lib/libbcc_bpf.so.0 /usr/lib/libbcc_bpf.so.0
COPY --from=build /usr/lib/libstdc++.so.6 /usr/lib/libstdc++.so.6
COPY --from=build /usr/lib/libgcc_s.so.1 /usr/lib/libgcc_s.so.1
FROM scratch AS bpftrace-bin
COPY --from=builder /out/opt/zededa/usr/bin/bpftrace-aotrt /usr/local/bin/bpftrace-aotrt
COPY --from=builder /usr/lib/libbpf.so.0 /usr/lib/libbpf.so.0
COPY --from=builder /usr/lib/libelf.so.1 /usr/lib/libelf.so.1
COPY --from=builder /lib/libz.so.1 /lib/libz.so.1
COPY --from=builder /usr/lib/libbcc_bpf.so.0 /usr/lib/libbcc_bpf.so.0
COPY --from=builder /usr/lib/libstdc++.so.6 /usr/lib/libstdc++.so.6
COPY --from=builder /usr/lib/libgcc_s.so.1 /usr/lib/libgcc_s.so.1

FROM bpftrace-bin AS build-amd64
FROM bpftrace-bin AS build-arm64
FROM scratch AS build-riscv64

# hadolint ignore=DL3006
FROM build-${TARGETARCH} AS build

0 comments on commit c9a9a19

Please sign in to comment.