I am trying to run docker login, but I am getting the following error:
Error response from daemon: Get "https://[removed_id_for_stackoverflow].dkr.ecr.us-east-1.amazonaws.com/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
I have the following within my ~/.bash.rc file:
export HTTP_PROXY="http://192.168.1.1:8080"
export HTTPS_PROXY="http://192.168.1.1:8080"
export https_proxy="http://192.168.1.1:8080"
export https_proxy="http://192.168.1.1:8080"
export ftp_proxy="http://192.168.1.1:8080"
export no_proxy="localhost,127.0.0.1,::1"
If I run curl https://www.google.com then I can get a valid response, confirming that these settings work. If I remove these environment variables, then my curl command no longer works, so I'm pretty sure it's configured correctly from an environment variable perspective.
According to Docker Hub login behind a proxy, you can just pass the proxy options into the command line when running docker login; however, I've tried this and the results are the same. See the example below:
root@my-host:~/.docker# HTTPS_PROXY=http://192.168.1.1:8080 aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $(aws sts get-caller-identity --output text --query 'Account').dkr.ecr.us-east-1.amazonaws.com >/dev/null
Error response from daemon: Get "https://[removed_for_stack_overflow].dkr.ecr.us-east-1.amazonaws.com/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
I tried changing the proxy settings to appear before docker login instead of aws, tried using HTTP_PROXY instead of HTTPS_PROXY, but still no luck. Doesn't seem to matter in which order the proxy options are specified.
I also have a file called ~/.docker/config.json that contains the following proxy information:
{
"proxies":
{
"default":
{
"httpProxy": "http://192.168.1.1:8080",
"httpsProxy": "http://192.168.1.1:8080"
}
}
}
Even with this setting, docker login doesn't appear to be working still and provides the same results.