World map

 

BM: Baca dalam Bahasa Melayu

World D5: Ship & Shield

Scan for holes: Scout and Trivy

You will learn: to scan an image for known holes, read the report and fix the worst ones.

Checked with Docker Engine 29 on 31 Oct 2026

The problem

bash
trivy image nginx:1.29-alpine
…
Total: 232 (UNKNOWN: 4, LOW: 96, MEDIUM: 84, HIGH: 47, CRITICAL: 1)
Trivy scans the image nginx:1.29-alpine. The last line says: Total 232, with 1 CRITICAL and 47 HIGH.

An older nginx image. The food inspector found 232 known holes. One is CRITICAL. Where do you even start?

Watch

A vulnerability scanner: The food inspector: checks every package in an image against lists of known holes (CVEs). reads every package in the pack. It checks each one against public lists of known holes, called CVE: A public ID for a known security hole, like CVE-2099-0001. Each gets a severity.. Here is the CRITICAL one.

Tap the line that tells you the fix.

0 of 1 found

Try it

Docker’s own inspector is Docker Scout. It needs a free Docker login. Build the command that lists only the worst holes.

Tap the pieces in the right order.

…

Predict

The CRITICAL hole is in brotli-libs, which came with the base image. What is the best fix?

Pick one answer.

Watch

bash
trivy image --severity CRITICAL --exit-code 1 kedai:1.0
…
Total: 1 (CRITICAL: 1)
echo $?
1
trivy image --severity CRITICAL --exit-code 1 kedai:1.1
…
echo $?
0
kedai:1.0 has 1 CRITICAL hole, so Trivy exits with 1. kedai:1.1 upgrades brotli-libs and Trivy exits with 0.

kedai:1.0 is built on nginx:1.30-alpine, with the same hole. --exit-code 1 turns a CRITICAL into a failure. Version 1.1 adds one recipe line: RUN apk upgrade --no-cache brotli-libs. Now it passes.

Check

Good scanning habit? Swipe right for yes.

Swipe right for good, left for needs work. Or use the buttons.

1 / 4

Scan the pack before you push it

Scan the pack before you push it

You did it!

You can now scan an image and fix its worst holes.

Go deeper (optional)

Scout needs a Docker account and checks your local images. Trivy is open source and needs no account. Both read the packages in the image, so neither finds bugs in code you wrote. docker scout cves --exit-code returns 2 when it finds holes. Trivy’s --ignore-unfixed hides holes with no fix yet.

Real rep (optional), with Trivy installed from its official docs:

Real mission

  1. trivy image --severity HIGH,CRITICAL alpine:3.22
  2. docker scout quickview alpine:3.22

0 of 4 steps done · Your ticks are saved.