Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I have docker-compose which fetches some of the images and builds one. When I run docker-compose up , I am getting the following error

ERROR: 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).

Question: How to pass the COMPOSE_HTTP_TIMEOUT with docker-compose command?

like image 221
gurubelli Avatar asked Apr 07 '16 22:04

gurubelli


People also ask

Does Docker compose override Dockerfile CMD?

Docker-compose command doesn't override Dockerfile CMD.

What is Compose_http_timeout?

“COMPOSE_HTTP_TIMEOUT” sets how much time (seconds) that a request to the Docker daemon has before it times out.

What is TTY true in Docker compose?

If you write “tty: true” in the docker-compose. yml, you will be able to “keep the container running”.

What is Depends_on in Docker compose?

depends_on is a Docker Compose keyword to set the order in which services must start and stop. For example, suppose we want our web application, which we'll build as a web-app image, to start after our Postgres container.


2 Answers

COMPOSE_HTTP_TIMEOUT is an environment variable, so

COMPOSE_HTTP_TIMEOUT=200 docker-compose up 
like image 91
dnephin Avatar answered Oct 08 '22 12:10

dnephin


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

like image 34
dzof31 Avatar answered Oct 08 '22 12:10

dzof31