diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 868713d5..2822090e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,8 +12,6 @@ on: branches: - master pull_request: - branches: - - master env: REPO_SLUG: tonistiigi/binfmt @@ -29,6 +27,7 @@ jobs: target: - mainline - buildkit + - desktop steps: - name: Checkout @@ -85,6 +84,7 @@ jobs: target: - mainline - buildkit + - desktop steps: - name: Checkout @@ -138,14 +138,22 @@ jobs: strategy: fail-fast: false matrix: + target: + - mainline + - desktop dockerfile: - pip-youtube-dl - webpack platform: - linux/arm/v7 include: - - dockerfile: ejabberd + - target: mainline + dockerfile: ejabberd platform: linux/arm64 + - target: desktop + dockerfile: tini + platform: linux/arm64 + run: true steps: - name: Checkout @@ -154,14 +162,14 @@ jobs: name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Load mainline for testing + name: Load for testing uses: docker/bake-action@v2 with: - targets: mainline + targets: ${{ matrix.target }} load: true set: | - *.cache-from=type=gha,scope=${{ env.CACHE_GHA_SCOPE }}-mainline - mainline.tags=tonistiigi/binfmt:test + *.cache-from=type=gha,scope=${{ env.CACHE_GHA_SCOPE }}-${{ matrix.target }} + *.tags=tonistiigi/binfmt:test - name: Set up QEMU run: | @@ -172,6 +180,18 @@ jobs: working-directory: test/dockerfiles/${{ matrix.dockerfile }} run: | docker buildx build --platform ${{ matrix.platform }} --output type=cacheonly . + - + name: Load image + if: ${{ matrix.run }} + working-directory: test/dockerfiles/${{ matrix.dockerfile }} + run: | + docker buildx build --platform ${{ matrix.platform }} -t ${{ matrix.dockerfile }}:local --load . + - + name: Run + if: ${{ matrix.run }} + working-directory: test/dockerfiles/${{ matrix.dockerfile }} + run: | + docker run --rm --platform ${{ matrix.platform }} ${{ matrix.dockerfile }}:local build: runs-on: ubuntu-latest @@ -185,6 +205,7 @@ jobs: target: - mainline - buildkit + - desktop steps: - name: Checkout diff --git a/docker-bake.hcl b/docker-bake.hcl index 7917a3f0..d707c69c 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -77,6 +77,18 @@ target "buildkit-test" { tags = [] } +target "desktop" { + inherits = ["mainline"] + args = { + QEMU_PATCHES = "${QEMU_PATCHES},subreaper-prctl" + } + cache-from = ["${REPO}:desktop-master"] +} + +target "desktop-all" { + inherits = ["desktop", "all-arch"] +} + target "archive" { inherits = ["mainline"] target = "archive" diff --git a/patches/subreaper-prctl/0001-linux-user-pass-SUBREAPER-to-prctl.patch b/patches/subreaper-prctl/0001-linux-user-pass-SUBREAPER-to-prctl.patch new file mode 100644 index 00000000..8bdd56f0 --- /dev/null +++ b/patches/subreaper-prctl/0001-linux-user-pass-SUBREAPER-to-prctl.patch @@ -0,0 +1,35 @@ +From fb2d9448acae73a193aede5b6c966e2e578987e6 Mon Sep 17 00:00:00 2001 +From: CrazyMax +Date: Thu, 11 May 2023 18:23:03 +0200 +Subject: [PATCH] linux-user: pass SUBREAPER to prctl + +Reaper status can be aquired by using prctl() with +PR_*_CHILD_SUBREAPER on linux. Signal will be delivered +to every descendant process. + +Signed-off-by: CrazyMax +--- + linux-user/syscall.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/linux-user/syscall.c b/linux-user/syscall.c +index b8a75f35d2..4c66d9fe37 100644 +--- a/linux-user/syscall.c ++++ b/linux-user/syscall.c +@@ -6548,11 +6548,11 @@ static abi_long do_prctl(CPUArchState *env, abi_long option, abi_long arg2, + case PR_SET_NO_NEW_PRIVS: + case PR_GET_IO_FLUSHER: + case PR_SET_IO_FLUSHER: ++ case PR_GET_CHILD_SUBREAPER: ++ case PR_SET_CHILD_SUBREAPER: + /* Some prctl options have no pointer arguments and we can pass on. */ + return get_errno(prctl(option, arg2, arg3, arg4, arg5)); + +- case PR_GET_CHILD_SUBREAPER: +- case PR_SET_CHILD_SUBREAPER: + case PR_GET_SPECULATION_CTRL: + case PR_SET_SPECULATION_CTRL: + case PR_GET_TID_ADDRESS: +-- +2.34.0 + diff --git a/test/dockerfiles/tini/Dockerfile b/test/dockerfiles/tini/Dockerfile new file mode 100644 index 00000000..33682c56 --- /dev/null +++ b/test/dockerfiles/tini/Dockerfile @@ -0,0 +1,22 @@ +# syntax=docker/dockerfile:1 + +ARG TINI_VERSION="v0.19.0" + +FROM alpine:3.17 +RUN apk add --no-cache file wget +ARG TINI_VERSION +ARG TARGETPLATFORM +RUN <