Ubuntu image installs apt packages without apt-get update
Summary: The package install runs against an image with no fresh package lists, causing apt to fail in a clean build.
Failure type: apt_update_missing
Ecosystem: linux
Difficulty: easy

Repository files:
path: Dockerfile
content: FROM ubuntu:24.04
RUN apt-get install -y curl ca-certificates
CMD ["curl", "--version"]

Failure log:
Reading package lists...
E: Unable to locate package curl
E: Unable to locate package ca-certificates

Build command: docker build -t sabnock/sbd-0011 .
Verify commands:
docker build -t sabnock/sbd-0011 .

Oracle patch:
diff --git a/Dockerfile b/Dockerfile
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,3 +1,3 @@
 FROM ubuntu:24.04
-RUN apt-get install -y curl ca-certificates
+RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates && rm -rf /var/lib/apt/lists/*
 CMD ["curl", "--version"]

Scoring - must touch:
Dockerfile
Scoring - must contain:
path: Dockerfile
text: apt-get update && apt-get install
path: Dockerfile
text: rm -rf /var/lib/apt/lists/*
Scoring - must not contain: