0

Error response from daemon: Get https://registry-1.docker.io/v2/: proxyconnect tcp: tls: first record does not look like a TLS handshake

I am getting above error response, but i am able to connect with internet from my system using the same proxy. ( I have username and passowrd in my proxy link)

export http_proxy=http://:@proxyurl:8080

Nishad A
  • 103
  • 1
  • 12

2 Answers2

2

1.Create a systemd drop-in directory for the docker service:

$ sudo mkdir -p /etc/systemd/system/docker.service.d

2.Create a file called /etc/systemd/system/docker.service.d/http-proxy.conf that adds the HTTP_PROXY environment variable:

[Service]
Environment="HTTP_PROXY=http://<username>:<password>@<host>:<port>"

Or, if you are behind an HTTPS proxy server, create a file called /etc/systemd/system/docker.service.d/https-proxy.conf that adds the HTTPS_PROXY environment variable:

[Service]
Environment="HTTPS_PROXY=http://<username>:<password>@<host>:<port>"

3.Flush changes:

$ sudo systemctl daemon-reload

4.Restart Docker:

$ sudo systemctl restart docker

Docker has published the above info with some additional info at https://docs.docker.com/config/daemon/systemd/

rajesh-nitc
  • 5,049
  • 3
  • 25
  • 33
0

I got the answer: create a file in the below location: /etc/systemd/system/docker.service.d/http-proxy.conf and set proxy in it

Environment="HTTPS_PROXY=http://<username>:<password>@<host>:8080"
Nishad A
  • 103
  • 1
  • 12