Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker run connection timeout

While running

sudo docker pull centos

it gives connection time out, While it is running behind proxy where the proxy has been set http_proxy & https_proxy. What is the reason apart from proxy,though it seems proxy issue.I checked LINK but in vain, is there some other settings i am missing please let me know.

2014/11/10 23:31:53 Get https://index.docker.io/v1/repositories/centos/images: dial tcp 162.242.195.84:443: connection timed out

like image 649
Anil Avatar asked Nov 11 '14 09:11

Anil


People also ask

Does docker have a timeout?

If your docker start and docker create API calls take longer than four minutes, then AWS Batch returns a DockerTimeoutError error. Note: The default timeout limit set by the Amazon Elastic Container Service (Amazon ECS) container agent is four minutes.

How do I force a docker container to keep running?

The simplest way to keep the container running is to pass a command that never ends. We can use never-ending commands in any of the following ways: ENTRYPOINT or CMD directive in the Dockerfile. Overriding ENTRYPOINT or CMD in the docker run command.

How do I pass an environment variable in docker run?

When we launch our Docker container, we can pass environment variables as key-value pairs directly into the command line using the parameter –env (or its short form -e). As can be seen, the Docker container correctly interprets the variable VARIABLE1.

Does docker auto restart after crash?

no: Containers will not restart automatically. on-failure[:max-retries]: Restart the container if it exits with a non-zero exit code and provide a maximum number of attempts for the Docker daemon to restart the container. always: Always restart the container if it stops.


4 Answers

If you are running behind proxy then,

  1. add following command or line in /etc/default/docker file,

export http_proxy=<YOUR_PROXY>

  1. Restart docker service and check,

# service docker restart

like image 56
Rahul Khengare Avatar answered Oct 18 '22 06:10

Rahul Khengare


I was getting timeouts on Windows 10 Docker 17.03.0-ce-rc1

To fix it I opened Settings / Network and then set the DNS server to 8.8.8.8

like image 28
crowne Avatar answered Oct 18 '22 08:10

crowne


  1. service docker stop
  2. HTTP_PROXY=http://proxy_ip:port/ docker -d &

This should work.

On Ubuntu, you can add HTTP_PROXY and HTTPS_PROXY to /etc/default/docker

like image 41
Blue Sky Avatar answered Oct 18 '22 07:10

Blue Sky


So yes, what worked for me at the end is setting the proxy, as mentioned by other answers.

I went to icon tray --> Right click on docker to windows --> Go to settings --> set the proxy as ip:port

Please refer screenshot as below enter image description here

like image 1
Chaitanya Gadkari Avatar answered Oct 18 '22 08:10

Chaitanya Gadkari