Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,32 @@ jobs:
scanners: vuln
ignore-unfixed: true
exit-code: '1'

# Docker Scout uses its own vulnerability data, which can disagree with
# Trivy's (CVE-2026-107891 in musl was reported only by Scout). This is
# what Docker Hub shows for the image, so the build has to pass it too.
# Needs the Docker Hub credentials; skipped without them.
- name: Scan image with Docker Scout
if: matrix.arch == 'amd64' && env.DOCKERHUB_PASSWORD != ''
uses: docker/scout-action@b265cd48f8a1451d2680815b3e8dc4ed65ee16e7 # v1.30.0
with:
command: cves
image: local://nginx:ci
only-fixed: true
exit-code: true
write-comment: false
dockerhub-user: ${{ vars.DOCKERHUB_USERNAME || secrets.DOCKERHUB_USERNAME }}
dockerhub-password: ${{ env.DOCKERHUB_PASSWORD }}

# Report only: what Docker Scout currently says about the published
# image, for comparison with the build above.
- name: Docker Scout report for the published image
if: matrix.arch == 'amd64' && env.DOCKERHUB_PASSWORD != ''
continue-on-error: true
uses: docker/scout-action@b265cd48f8a1451d2680815b3e8dc4ed65ee16e7 # v1.30.0
with:
command: cves
image: registry://docker.io/${{ vars.DOCKERHUB_IMAGE || format('{0}/nginx', vars.DOCKERHUB_USERNAME || secrets.DOCKERHUB_USERNAME) }}:latest
write-comment: false
dockerhub-user: ${{ vars.DOCKERHUB_USERNAME || secrets.DOCKERHUB_USERNAME }}
dockerhub-password: ${{ env.DOCKERHUB_PASSWORD }}
14 changes: 14 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,20 @@ jobs:
ignore-unfixed: true
exit-code: '1'

# Same check as Docker Hub's own scanner, so a release is not published
# with a finding Docker Hub would show. Runs when Docker Hub is set up.
- name: Scan image with Docker Scout
if: steps.registries.outputs.dockerhub == 'true'
uses: docker/scout-action@b265cd48f8a1451d2680815b3e8dc4ed65ee16e7 # v1.30.0
with:
command: cves
image: local://nginx:release-test
only-fixed: true
exit-code: true
write-comment: false
dockerhub-user: ${{ vars.DOCKERHUB_USERNAME || secrets.DOCKERHUB_USERNAME }}
dockerhub-password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Log in to GHCR
uses: docker/login-action@v4
with:
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
![Non-root](https://img.shields.io/badge/runs%20as-non--root-success)
![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)
![Vulnerability scan](https://img.shields.io/badge/scanned%20by-Trivy%20%7C%20Docker%20Scout-1904DA)
[![Dependabot](https://img.shields.io/badge/Dependabot-enabled-025E8C?logo=dependabot)](.github/dependabot.yml)

A small, hardened nginx image built from source: HTTP/1.1, HTTP/2 and HTTP/3 (QUIC) on the standard ports, running entirely as a non-root user.
Expand Down Expand Up @@ -277,6 +277,7 @@ The smoke test starts the image read-only with all capabilities dropped and chec
- **Lint**: hadolint for the Dockerfile, ShellCheck for the scripts, actionlint for the workflows.
- **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.
- **Docker Scout** scan with the same rule, when the Docker Hub credentials are set. Scout is what Docker Hub shows for the image and its data can differ from Trivy's, so both have to pass. The log also shows Scout's current report for the published image.

[Dependabot](.github/dependabot.yml) opens weekly pull requests for new versions of the GitHub Actions, the Alpine base image and the test dependencies.

Expand Down