bash
cat /etc/docker/daemon.json
bash
{
"max-concurrent-downloads": 30,
"max-download-attempts": 10,
}
参数解释:
"max-concurrent-downloads":30, 最多一次性拉取 30 层
"max-download-attempts": 10, 最多重试10次
从 /var/log/syslog 日志可知,dokcer 拉取某层失败会重试,默认重试次数为 5 ,"max-download-attempts": 10, 可以将失败重试次数改为 10
bash
Jan 8 14:36:37 m4 dockerd[112390]: time="2024-01-08T14:36:37.144264291+08:00" level=info msg="Download failed, retrying (1/10): unexpected EOF"
Jan 8 14:41:09 m4 dockerd[112390]: time="2024-01-08T14:41:09.315140436+08:00" level=info msg="Download failed, retrying (2/10): unexpected EOF"
Jan 8 14:50:12 m4 dockerd[112390]: time="2024-01-08T14:50:12.149905672+08:00" level=info msg="Download failed, retrying (3/10): unexpected EOF"
Jan 8 14:54:55 m4 dockerd[112390]: time="2024-01-08T14:54:55.540293984+08:00" level=info msg="Download failed, retrying (4/10): unexpected EOF"
Jan 8 15:04:09 m4 dockerd[112390]: time="2024-01-08T15:04:09.474033826+08:00" level=info msg="Download failed, retrying (5/10): unexpected EOF"