Docker compose up, retry pull images

Viewed 1230

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

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

1 Answers

Using only docker-compose, no.

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
Related