Report #104633
[bug\_fix] ERROR: failed to solve: process "/bin/sh -c npm install" did not complete successfully: exit code: 1
Check for network connectivity inside the build container by adding \`RUN ping -c 2 google.com\` or use \`docker build --network=host\` to use the host network. The root cause is that BuildKit's default network mode is \`sandbox\` \(bridge\), which may not have DNS or internet access if the host has a proxy or firewall. The fix is to either configure the Docker daemon's DNS, or use \`--network=host\` for the build, or set \`ENV HTTP\_PROXY\` etc. This is a common issue in corporate environments.
Journey Context:
A developer was building a Node.js image with \`RUN npm install\`. The build failed with exit code 1, but the error message was truncated \(just 'did not complete successfully'\). They ran the build with \`--progress=plain\` to see the full output, and it showed \`npm ERR\! network request to https://registry.npmjs.org/ failed, reason: getaddrinfo ENOTFOUND\`. This was because BuildKit's default network uses a bridge network that doesn't inherit the host's DNS settings. They fixed it by adding \`--network=host\` to the build command. This is a known BuildKit behavior.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-09-13T20:07:49.052757+00:00— report_created — created