Skip to content

Commit

Permalink
chore(build): Add base image Dockerfile for building kepler with libb…
Browse files Browse the repository at this point in the history
…pf (#1103)

- Adds Dockerfile.base which installs everything required to build kepler code base
  - Updated github workflow to build and push the base image

Signed-off-by: Vimal Kumar <[email protected]>
  • Loading branch information
vimalk78 authored Dec 5, 2023
1 parent 57c2cb6 commit 871d598
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/image_base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,13 @@ jobs:
platforms: linux/amd64
push: true
tags: quay.io/sustainable_computing_io/kepler_base:latest-libbpf-amd64
- name: Build and push a base image for building Kepler with libbpf
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.base
platforms: linux/amd64
push: true
tags: quay.io/sustainable_computing_io/kepler_base:latest-libbpf-amd64-simplified
- name: Create and upload multi-arch image
run: make multi-arch-image-base
33 changes: 33 additions & 0 deletions Dockerfile.base
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM registry.access.redhat.com/ubi9/go-toolset:1.20 as builder

USER 0

RUN yum -y install yum-utils
RUN yum-config-manager --enable ubi-9-baseos-source

WORKDIR /elfutils-source
RUN yumdownloader --source elfutils
RUN yum -y install cpio
RUN rpm2cpio elfutils-0.189-3.el9.src.rpm | cpio -iv
RUN tar xjvf elfutils-0.189.tar.bz2
WORKDIR /elfutils-source/elfutils-0.189
RUN ./configure --disable-debuginfod
RUN make install


WORKDIR /libbpf-source
RUN yumdownloader --source libbpf
RUN rpm2cpio libbpf-1.2.0-1.el9.src.rpm | cpio -iv
RUN tar xf ./linux-*el9.tar.xz
WORKDIR /libbpf-source/linux-5.14.0-333.el9/tools/lib/bpf
RUN make install_headers
RUN prefix=/usr BUILD_STATIC_ONLY=y make install
WORKDIR /libbpf-source/linux-5.14.0-333.el9/tools/bpf
RUN make bpftool

RUN yum -y install clang

# enable EPEL and install cpuid
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
RUN yum install -y cpuid
RUN yum clean all

0 comments on commit 871d598

Please sign in to comment.