docker build stops while loading metadata for the base image
ERROR [internal] load metadata for docker.io/library/node:22Short answer
The build could not look up the base image from FROM. Two things cause most of it: a credsStore entry in ~/.docker/config.json that names a helper which is not on PATH, and a daemon that needs a proxy to reach the registry. Read the full error line after the metadata message to tell them apart.
Fix it fast
1Find out which cause you have
Print the Docker client config and look for credsStore or credHelpers, then try a plain pull to separate a registry problem from a build problem.
cat ~/.docker/config.json docker pull hello-world2Match what you see, then jump to its fix
What does the error look like?
ERROR [internal] load metadata for docker.io/library/node:22
Cause 1 of 2
The credential helper in config.json is not on PATH
1Check
The value of credsStore is the suffix of a helper program, and Docker requires that program to be on the client's PATH.
grep -n -E "credsStore|credHelpers" ~/.docker/config.json
which docker-credential-desktop docker-credential-osxkeychain2Fix
Put the helper's folder on PATH, or remove the credsStore line if you do not need a store. If you are logged in, run docker logout first, then log in again.
docker logout
sudoedit ~/.docker/config.json # delete the "credsStore" line
docker login3Verify
A pull works again.
docker pull hello-worldConfirmed by docs.docker.com
Cause 2 of 2
The daemon needs a proxy to reach the registry
1Check
The daemon uses its own proxy settings to reach Docker Hub and other registries. Show what systemd gave it.
sudo systemctl show --property=Environment docker2Fix
Set the proxy in daemon.json, or in a systemd drop-in. On Docker Desktop, set it in the app settings; proxies in daemon.json are ignored there.
{
"proxies": {
"http-proxy": "http://proxy.example.com:3128",
"https-proxy": "http://proxy.example.com:3128",
"no-proxy": "localhost,127.0.0.1"
}
}3Verify
Restart the daemon and pull again.
sudo systemctl restart docker
docker pull hello-worldConfirmed by docs.docker.com
How do I stop it coming back?
- Keep credential helpers installed and on PATH, or do not configure a store.
- Record proxy settings in the machine setup, not as a one-off terminal export.
- Pull a small image with docker pull as the first test when builds fail early.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Servers
docker pull cannot download images behind a corporate proxy
curl through the proxy works in your shell, while docker pull fails
docker pull is done by the daemon, not by your shell, so exporting HTTP_PROXY in the terminal changes nothing.
3 causes, each with a fixServers
apk cannot find py-pip in an Alpine Docker image
py-pip (no such package):
On current Alpine releases there is no package called py-pip.
2 causes, each with a fixServers
ng serve runs in the container but localhost:4200 does not open
The browser cannot open localhost:4200 although ng serve is running in the container
ng serve listens on localhost by default, which inside a container is the container itself.
3 causes, each with a fixServers
Angular routes return 404 from nginx when you refresh or open a link
The home page loads, but refreshing /some/route shows an nginx 404
Angular routes like /users/42 are not files, so nginx looks for them on disk and returns 404.
3 causes, each with a fixServers
AH00558: Apache in Docker cannot reliably determine its fully qualified domain name
Set the 'ServerName' directive globally to suppress this message
AH00558 is a warning, not a crash.
2 causes, each with a fixServers
Apache in a Docker container logs AH01114 when it proxies to a backend
AH01114: HTTP: failed to make connection to backend: api
Apache's proxy worker could not open a connection to the address in ProxyPass.
5 causes, each with a fix