From: Jo Zzsi Date: Sat, 24 Jan 2026 23:20:54 +0000 (-0500) Subject: ci(busybox): install more non-busybox binaries X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31a1c36880c37da52b6ba5b3e47b939ef4e5033a;p=thirdparty%2Fdracut-ng.git ci(busybox): install more non-busybox binaries 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. --- diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index c6ac14ad5..8ad9598d1 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -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' diff --git a/test/container/Dockerfile-alpine b/test/container/Dockerfile-alpine index 336da72f7..738950d4f 100644 --- a/test/container/Dockerfile-alpine +++ b/test/container/Dockerfile-alpine @@ -15,12 +15,11 @@ # - 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 index 5ba160395..000000000 --- a/test/container/Dockerfile-alpine-busybox +++ /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)