Skip to content

Commit a013a87

Browse files
committed
Add Debian-based image
1 parent 4d4800e commit a013a87

File tree

4 files changed

+42
-20
lines changed

4 files changed

+42
-20
lines changed

Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ FROM myoung34/github-runner:ubuntu-${UBUNTU_VERSION}
55
ARG UBUNTU_VERSION
66

77
COPY install-dependencies.sh /tmp/install-dependencies.sh
8-
RUN bash /tmp/install-dependencies.sh
9-
10-
RUN apt-get clean
8+
RUN bash /tmp/install-dependencies.sh all
119

1210
COPY token.sh /token.sh
1311

install-dependencies.sh

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,40 @@
11
#!/bin/bash
22

3-
set -euo pipefail
3+
set -xeuo pipefail
4+
5+
export DEPS=${1:-"all"} # "build", "run" or "all"
46

57
# Most of the BPF CI dependencies are set up by libbpf/ci/setup-build-env action
68
# This script runs a subset of that, in order to cache the packages at image build time
7-
export LIBBPF_CI_TAG=v3
9+
export LIBBPF_CI_TAG=${LIBBPF_CI_TAG:-"v3"}
10+
export RUNNER_VERSION=${RUNNER_VERSION:-2.331.0}
811

912
# These should correspond to https://github.com/kernel-patches/vmtest/blob/master/.github/scripts/matrix.py#L20-L21
10-
# Otherwise there is no point in caching dependencies in the image
11-
export GCC_VERSION=15
12-
export LLVM_VERSION=21
13-
14-
# do not install pahole and cross-compilation toolchain in the docker image
15-
export TARGET_ARCH=$(uname -m)
16-
export PAHOLE_BRANCH=none
13+
# Otherwise there is no point in caching the dependencies in the image
14+
export GCC_VERSION=${GCC_VERSION:-14}
15+
export LLVM_VERSION=${LLVM_VERSION:-21}
1716

1817
scratch=$(mktemp -d)
1918
cd $scratch
19+
20+
# Install pre-requisites for GitHub Actions Runner client app
21+
# https://github.com/actions/runner/blob/main/docs/start/envlinux.md
22+
curl -Lf https://raw.githubusercontent.com/actions/runner/v${RUNNER_VERSION}/src/Misc/layoutbin/installdependencies.sh \
23+
-o install-gha-runner-deps.sh
24+
bash install-gha-runner-deps.sh
25+
26+
# Use libbpf/ci/setup-build-env scripts
2027
git clone --depth 1 --branch $LIBBPF_CI_TAG https://github.com/libbpf/ci.git actions
2128

22-
# Install build dependencies only on x86_64, we cross-compile everything else
23-
if [ "$(uname -m)" == "x86_64" ]; then
29+
if [ "$DEPS" = "all" ] || [ "$DEPS" = "build" ]; then
30+
# do not install cross-compilation toolchain by default
31+
export TARGET_ARCH=$(uname -m)
2432
cd "${scratch}/actions/setup-build-env" && ./action.sh
2533
fi
2634

27-
cd "${scratch}/actions/run-vmtest" && ./install-dependencies.sh
35+
if [ "$DEPS" = "all" ] || [ "$DEPS" = "run" ]; then
36+
cd "${scratch}/actions/run-vmtest" && ./install-dependencies.sh
37+
fi
38+
39+
cd / && rm -rf $scratch
40+
sudo apt-get clean

kbuilder-debian.Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM debian:trixie
2+
3+
ARG RUNNER_VERSION=2.331.0
4+
ENV DEBIAN_FRONTEND=noninteractive
5+
6+
RUN apt-get update -y && apt-get install -y --no-install-recommends \
7+
ca-certificates curl git sudo wget
8+
9+
COPY setup-mirror-repos.sh /tmp/setup-mirror-repos.sh
10+
RUN bash /tmp/setup-mirror-repos.sh
11+
12+
ENV LIBBPF_CI_TAG=debian-build-env
13+
COPY install-dependencies.sh /tmp/install-dependencies.sh
14+
RUN bash /tmp/install-dependencies.sh build
15+
16+
RUN apt-get clean

setup-mirror-repos.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22

33
set -euo pipefail
44

5-
if [ "$(uname -m)" != "x86_64" ]; then
6-
echo "Skip setting up mirror repos in non-x86_64 image"
7-
exit 0
8-
fi
9-
105
mkdir -p /libbpfci/mirrors
116
git clone https://github.com/kernel-patches/bpf.git /libbpfci/mirrors/linux
127
chmod -R a+rX /libbpfci/mirrors

0 commit comments

Comments
 (0)