Interview Prep/GitHub Actions/Caching, Artifacts, Builds & Scans

`ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref ...: "/package-lock.json": not found`

IntermediateTroubleshootingCaching, Artifacts, Builds & Scans
Answer

Likely causes → The Docker build context is not where the Dockerfile expects (context: . vs services/api), .dockerignore excludes the file, or checkout did not include it (sparse).

Diagnose →

cat .dockerignore
ls services/api

Fix → Set context: services/api and file: services/api/Dockerfile, fix .dockerignore.

Prevent → Build locally with the same context path as CI.

All GitHub Actions questions Roadmap: GitHub Actions

More on Caching, Artifacts, Builds & Scans