diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc945ec..ed21f28 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,15 +44,29 @@ jobs: matrix: include: - arch: amd64 + platform: linux/amd64 runner: ubuntu-24.04 - arch: arm64 + platform: linux/arm64 runner: ubuntu-24.04-arm + # No native 32-bit ARM runner exists, so this one is built and + # tested under QEMU emulation and takes noticeably longer. + - arch: arm-v7 + platform: linux/arm/v7 + runner: ubuntu-24.04 + emulated: true runs-on: ${{ matrix.runner }} env: DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} steps: - uses: actions/checkout@v7 + - name: Set up QEMU + if: matrix.emulated + uses: docker/setup-qemu-action@v4 + with: + platforms: ${{ matrix.platform }} + - uses: docker/setup-buildx-action@v4 # Optional: lifts Docker Hub's anonymous pull limit for the Alpine base @@ -71,6 +85,7 @@ jobs: uses: docker/build-push-action@v7 with: context: . + platforms: ${{ matrix.platform }} load: true pull: true tags: nginx:ci diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7e66fee..87c6a85 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -228,7 +228,7 @@ jobs: uses: docker/build-push-action@v7 with: context: . - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/README.md b/README.md index 136f53a..cfe99b2 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ ![HTTP/3](https://img.shields.io/badge/HTTP%2F3-QUIC-success) ![HTTP/2](https://img.shields.io/badge/HTTP%2F2-enabled-success) ![Non-root](https://img.shields.io/badge/runs%20as-non--root-success) -![Platforms](https://img.shields.io/badge/platforms-amd64%20%7C%20arm64-informational) +![Platforms](https://img.shields.io/badge/platforms-amd64%20%7C%20arm64%20%7C%20arm%2Fv7-informational) ![Base](https://img.shields.io/badge/base-Alpine-0D597F?logo=alpinelinux&logoColor=white) ![Vulnerability scan](https://img.shields.io/badge/scanned%20by-Trivy-1904DA) [![Dependabot](https://img.shields.io/badge/Dependabot-enabled-025E8C?logo=dependabot)](.github/dependabot.yml) @@ -77,7 +77,7 @@ Ports: `80/tcp`, `443/tcp`, `443/udp`. - **Start-up hooks.** Executable `*.sh` files in `/docker-entrypoint.d/` run before nginx. - **Logs to stdout/stderr**, with an optional JSON access-log format. - **Graceful shutdown** on `docker stop` (`SIGQUIT`). -- **Multi-arch.** `linux/amd64` and `linux/arm64`. +- **Multi-arch.** `linux/amd64`, `linux/arm64` and `linux/arm/v7` (32-bit ARM, such as a Raspberry Pi with a 32-bit OS). ### Compiled-in modules @@ -206,7 +206,7 @@ git tag v1.31.10 git push origin v1.31.10 ``` -The [release workflow](.github/workflows/release.yml) builds the image, runs the smoke test and the vulnerability scan, then builds for `amd64` and `arm64` and pushes it to every configured registry with an SBOM and build provenance attached. Both registries always get the same image and the same tags. +The [release workflow](.github/workflows/release.yml) builds the image, runs the smoke test and the vulnerability scan, then builds for `amd64`, `arm64` and `arm/v7` and pushes it to every configured registry with an SBOM and build provenance attached. Both registries always get the same image and the same tags. ### Docker Hub @@ -275,7 +275,7 @@ The smoke test starts the image read-only with all capabilities dropped and chec [CI](.github/workflows/ci.yml) runs on every push and pull request: - **Lint**: hadolint for the Dockerfile, ShellCheck for the scripts, actionlint for the workflows. -- **Build and smoke test** on `amd64` and `arm64`, both on native runners. +- **Build and smoke test** on `amd64` and `arm64` on native runners, and on `arm/v7` under QEMU emulation. - **Vulnerability scan** with Trivy: fails on any finding in the image's Alpine packages that has a fix available, whatever its severity. The build runs `apk upgrade`, so every fixed package Alpine has published is in the image. nginx itself and the two modules are compiled from source, so they are not covered by the scan; keep them current through the pinned versions above. [Dependabot](.github/dependabot.yml) opens weekly pull requests for new versions of the GitHub Actions, the Alpine base image and the test dependencies. diff --git a/tests/smoke.sh b/tests/smoke.sh index a58021e..b8d0003 100755 --- a/tests/smoke.sh +++ b/tests/smoke.sh @@ -47,7 +47,8 @@ docker run --detach --name "$name" \ --publish "127.0.0.1:${https_port}:443/udp" \ "$image" >/dev/null -for _ in $(seq 1 30); do +# Up to 30 seconds: start-up under QEMU emulation (arm/v7 in CI) is slow. +for _ in $(seq 1 60); do fetch --output /dev/null "http://127.0.0.1:${http_port}/healthz" 2>/dev/null && break sleep 0.5 done