Interview Prep/Docker/Build failures and cache problems

`failed to solve: process "/bin/sh -c apt-get install -y curl" did not complete successfully: exit code: 100` with `E: Unable to locate package curl`

BeginnerTroubleshootingBuild failures and cache problems
Answer

Likely causes → Package index missing because apt-get update is in a separate cached layer or was never run (images ship without lists).

Diagnose → Re-run with docker build --progress=plain --no-cache ..

Fix → RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*.

Prevent → Always chain update and install.

All Docker questions Roadmap: Docker & containers

More on Build failures and cache problems