Docker整理,重试拉镜像 [英] Docker compose up, retry pull images

查看:129
本文介绍了Docker整理,重试拉镜像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有时会得到 Client.Timed,在等待头文件时超出超时,在运行 docker-compose up 作为其拉取图像时出错

We sometimes get Client.Timeout exceeded while awaiting headers errors when running docker-compose up as its pulling images.

有没有办法让docker-compose在拉取映像时重试?

Is there a way to get docker-compose to retry when it is pulling an image?

推荐答案

仅使用 docker-compose

docker-compose 命令没有专门公开用于重试拉取图像的标志,但是您始终可以使用bash

The docker-compose command does not specifically exposes a flag for retrying pulling the images, but you can always use bash magic for that:

while ! docker-compose pull; do sleep .1; done && docker-compose up

这篇关于Docker整理,重试拉镜像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆