lutaoact
lutaoact

Reputation: 4429

docker push failed: net/http: TLS handshake timeout

when I use docker push to push my images to docker hub, I will get error like this:

Post https://registry-1.docker.io/v2/lutaoact/docker-whale/blobs/uploads/: net/http: TLS handshake timeout

or:

Head https://registry-1.docker.io/v2/lutaoact/docker-whale/blobs/sha256:ce3756df5cd31626b2664e9ac3713eec2585a64b7b31350c963328137b6f391d: dial tcp 54.172.138.33:443: i/o timeout

maybe 54.172.138.33 is blocked. How could i set proxy for the docker to access this ip?

Upvotes: 4

Views: 6634

Answers (4)

PRANESH
PRANESH

Reputation: 43

for someone who still finds this can re-reun "docker push" command so that it will check for previously pushed layers if any layers are missing it will continue from that layer, it wont push from beginning.

Upvotes: 0

lutaoact
lutaoact

Reputation: 4429

docker support to configure a proxy server, doc.

You can set environment variables HTTP_PROXY and HTTPS_PROXY to set proxy. For example:

HTTP_PROXY=http://127.0.0.1:8123 docker pull hello-world
HTTPS_PROXY=https://127.0.0.1:8123 docker pull hello-world

You also can edit file ~/.docker/config.json to configure proxy:

{
 "proxies":
 {
   "default":
   {
     "httpProxy": "http://127.0.0.1:3001",
     "httpsProxy": "http://127.0.0.1:3001",
     "noProxy": "*.test.example.com,.example2.com"
   }
 }
}

Upvotes: 1

Dolphin
Dolphin

Reputation: 38677

Change the docker mirror to your local area mirror,for example,In China,you can use Azure Mirror:

"registry-mirrors" : [
    "https://dockerhub.azk8s.cn"
  ]

like this:

enter image description here

until 2020-03,it works fine.

Upvotes: 0

Manuh.__
Manuh.__

Reputation: 41

This error occurs mostly when I don't have good internet. Check your internet connection. It will resolve the issue.

Also create a docker registry cache: https://docs.docker.com/registry/recipes/mirror/

Upvotes: 1

Related Questions