]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
ci(busybox): install more non-busybox binaries
authorJo Zzsi <jozzsicsataban@gmail.com>
Sat, 24 Jan 2026 23:20:54 +0000 (18:20 -0500)
committerLaszlo <laszlo.gombos@gmail.com>
Sun, 25 Jan 2026 13:00:26 +0000 (08:00 -0500)
Redesign the way the busybox container is computed to make it
easier to maintain and eliminate the need to install additional
alpine packages later on.

The new approach inherits from the "regular" alpine dracut container
and replaces all GNU coreutils and GNU util-linux binaries with
busybox binaries.

This PR is reusing Dockerfile-alpine and have an OPTION variable to
prioritize busybox.

.github/workflows/container.yml
test/container/Dockerfile-alpine
test/container/Dockerfile-alpine-busybox [deleted file]

index c6ac14ad5dd6cce04d8047b0e8ceddf14b7afdb7..8ad9598d18d02f2d2f055e05ac63d3d464ff3fc3 100644 (file)
@@ -38,7 +38,7 @@ jobs:
                     - {platform: 'linux/arm64', runner: 'ubuntu-24.04-arm', tag: 'arm'}
                 config:
                     - {dockerfile: 'Dockerfile-alpine', tag: 'alpine:edge'}
-                    - {dockerfile: 'Dockerfile-alpine-busybox', tag: 'alpine:busybox-edge'}
+                    - {dockerfile: 'Dockerfile-alpine', tag: 'alpine:busybox-edge', option: 'busybox'}
                     - {dockerfile: 'Dockerfile-arch', tag: 'arch:latest'}
                     - {dockerfile: 'Dockerfile-debian', tag: 'debian:latest'}
                     - {dockerfile: 'Dockerfile-fedora', tag: 'fedora:latest'}
@@ -72,6 +72,7 @@ jobs:
                   platforms: ${{ matrix.architecture.platform }}
                   build-args: |
                       DISTRIBUTION=${{ matrix.config.tag }}
+                      OPTION=${{ matrix.config.option }}
     manifest:
         needs: container
         if: github.event_name == 'push' || github.event_name == 'schedule'
index 336da72f7840871bf1c7e010b5fec838a575862f..738950d4f79e566c5c62011d1f39ded996e7e3cd 100644 (file)
 # - multipath-tools (does not work well)
 # - kernel-install is not available
 
-ARG DISTRIBUTION=alpine
-FROM docker.io/${DISTRIBUTION}
+FROM docker.io/alpine:edge
 
 # export
-ARG DISTRIBUTION
 ARG TARGETARCH
+ARG OPTION
 
 # Use dracut-tests package to install dependencies for test suite
 RUN apk add --no-cache \
@@ -41,3 +40,14 @@ if [ "${TARGETARCH}" == "amd64" ]; then \
 # workaround for https://gitlab.alpinelinux.org/alpine/aports/-/issues/17907
 RUN \
   ln -sf /boot/vmlinuz-virt /boot/vmlinuz-$(cd /lib/modules; ls -1 | tail -1)
+
+# busybox container
+# replace all GNU coreutils and GNU util-linux binaries with busybox binaries
+RUN \
+if [ "$OPTION" == "busybox" ] ; then \
+  mkdir /busybox && cd /busybox && /bin/busybox --install -s /busybox ;\
+  cp -a /busybox/* /bin/ ;\
+  cp -a /busybox/* /sbin/ ;\
+  cp -a /busybox/* /usr/bin/ ;\
+  cp -a /busybox/* /usr/sbin/ ;\
+fi
diff --git a/test/container/Dockerfile-alpine-busybox b/test/container/Dockerfile-alpine-busybox
deleted file mode 100644 (file)
index 5ba1603..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-# Tiny container with busybox
-# GNU coreutils and GNU grep should not be installed
-
-FROM docker.io/alpine:edge
-
-RUN apk add --no-cache \
-    bash \
-    e2fsprogs \
-    eudev \
-    findmnt \
-    gcc \
-    kmod-dev \
-    linux-virt \
-    make \
-    musl-dev  \
-    musl-fts-dev \
-    qemu-system-$(uname -m)
-
-# workaround for https://gitlab.alpinelinux.org/alpine/aports/-/issues/17907
-RUN \
-  ln -sf /boot/vmlinuz-virt /boot/vmlinuz-$(cd /lib/modules; ls -1 | tail -1)