ERROR: for ... UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60) An HTTP request took too long to complete. Retry with --verbose to obtain debug information. If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 60).
出于各种原因(image堆叠的层太多、image内放了太多大文件或者其他不合理的操作)导致使用镜像启动一个容器的时候很慢很慢很慢很慢很慢...超过了docker-compose的默认timeout时间,docker client不能得到docker server的response,然后报错了:
ERROR: for ... UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60) An HTTP request took too long to complete. Retry with --verbose to obtain debug information. If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 60).
所以我们只要设置一下timeout就好了呀
重启一波服务
sudo systemctl restart docker
设置环境变量
export DOCKER_CLIENT_TIMEOUT=120
export COMPOSE_HTTP_TIMEOUT=120
当然,你觉得120s不够,可以再大一点。
viencoding.com版权所有,允许转载,但转载请注明出处和原文链接: https://viencoding.com/article/202