Problem Description
ERROR: failed to solve failed to do request: Head “https://registry-1.docker.io/v2/library/nginx/manifests/1.19.7”: EOF
Cause
- Replaced the mirror warehouse with a domestic mirror source;
- Modify the configuration of docker engine;
Post my modified configuration here. Two changes have been made. The source address of the domestic mirror image has been added registry-mirrors
and buildkit
changed to false
. The configuration file path is~.docker/daemon.json
{
"registry-mirrors": [
"http://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn/"
],
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"experimental": false,
"features": {
"buildkit": false
}
}
Solution
Use docker system
the series of commands to clear the image cache. In general, the operation and maintenance cleans up the image by docker rm i
deleting the image through the command. But this command will not delete docker build
the cache files generated by the command.
Check the cache first, docker system df
execute the command, and clear the cache in depth
docker system prune -a --force
Corresponding to -a deletes all unused images, -f or --force deletes them forcefully without confirmation.