[buildbot] buildmaster: add static apk utility

LEDE Commits lede-commits at lists.infradead.org
Wed Sep 25 23:41:26 PDT 2024


ynezz pushed a commit to buildbot.git, branch main:
https://git.openwrt.org/47b8824df7cd0d0ca9da10289b28a65837365ede

commit 47b8824df7cd0d0ca9da10289b28a65837365ede
Author: Petr Štetiar <ynezz at true.cz>
AuthorDate: Tue Sep 24 20:00:59 2024 +0000

    buildmaster: add static apk utility
    
    We need a relatively recent `apk` that can sign package indexes. You can
    find more details in the referenced issue below. However, it has not
    been released yet and is not available as a prebuilt download.
    Therefore, until it becomes available, let's build a static version and
    use that in the meantime.
    
    Fixes: a94d4e15fdc1 ("add APK signing logic")
    References: https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/11008
    Signed-off-by: Petr Štetiar <ynezz at true.cz>
---
 docker/buildmaster/Dockerfile | 26 ++++++++++++++++++++++++++
 tests/cram/master/02-apk.t    |  4 ++++
 2 files changed, 30 insertions(+)

diff --git a/docker/buildmaster/Dockerfile b/docker/buildmaster/Dockerfile
index 8d21245..51b9d9b 100644
--- a/docker/buildmaster/Dockerfile
+++ b/docker/buildmaster/Dockerfile
@@ -1,3 +1,28 @@
+FROM alpinelinux/build-base:latest-x86_64 AS apk-builder
+
+RUN abuild-apk add -u \
+	gcc \
+	git \
+	linux-headers \
+	lua5.3-dev \
+	lua5.3-lzlib \
+	make \
+	musl-dev \
+	openssl-dev \
+	openssl-libs-static \
+	zlib-dev \
+	zlib-static \
+	zstd-dev \
+	zstd-static
+
+ARG APK_TOOLS_COMMIT=74de0e9bd73d1af8720df40aa68d472943909804
+
+RUN git clone https://gitlab.alpinelinux.org/alpine/apk-tools.git /tmp/apk-tools
+WORKDIR /tmp/apk-tools
+RUN git checkout $APK_TOOLS_COMMIT
+RUN make -j$(nproc) static
+
+
 FROM        debian:11
 MAINTAINER  OpenWrt Maintainers
 
@@ -55,6 +80,7 @@ COPY docker/buildmaster/files/start.sh /start.sh
 COPY phase1 /phase1
 COPY phase2 /phase2
 COPY scripts /scripts
+COPY --from=apk-builder /tmp/apk-tools/src/apk.static /usr/bin/apk
 
 RUN \
     groupadd buildbot && \
diff --git a/tests/cram/master/02-apk.t b/tests/cram/master/02-apk.t
new file mode 100644
index 0000000..17818ff
--- /dev/null
+++ b/tests/cram/master/02-apk.t
@@ -0,0 +1,4 @@
+Check that apk is available and usable in master container:
+
+  $ docker run --entrypoint apk local/master | grep usage
+  usage: apk [<OPTIONS>...] COMMAND [<ARGUMENTS>...]




More information about the lede-commits mailing list