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

COMPOSE_HTTP_TIMEOUT is an environment variable, so

COMPOSE_HTTP_TIMEOUT=200 docker-compose up

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


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

Restarting Docker