How to override the default value of COMPOSE_HTTP_TIMEOUT with docker-compose command

Solution 1:

COMPOSE_HTTP_TIMEOUT is an environment variable, so

COMPOSE_HTTP_TIMEOUT=200 docker-compose up

Solution 2:

You need your COMPOSE_HTTP_TIMEOUT at your docker instance level (docker-compose up) and not inside your docker image. So the solution is to create a .env file and put this inside:

#.env
COMPOSE_HTTP_TIMEOUT=200

you can check the doc here

Solution 3:

For Mac users, restarting docker from the status bar icon fixed this issue:

Restarting Docker