Docker error: HTTP 408 response body: invalid char

2020-03-07 07:01发布

When I go docker pull hello-world I get the below error message:

Error response from daemon: error parsing HTTP 408 response body: invalid character '<' looking for beginning of value: "<html><body><h1>408 Request Time-out</h1>\nYour browser didn't send a complete request in time.\n</body></html>\n\n"

Installed Docker version:

Client:
 Version:      1.11.2
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   b9f10c9
 Built:        Wed Jun  1 21:47:50 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.11.2
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   b9f10c9
 Built:        Wed Jun  1 21:47:50 2016
 OS/Arch:      linux/amd64

Installed using: curl -fsSL https://get.docker.com/ | sh

I have ensured that network exists and I can reach other sites. Please help

Update 1: The issue cannot be of setting MTU because I could pull the images from Docker hub a few days back on the same machine.

The issue cannot be of HTTP_PROXY either because I am in my home network

标签: docker
2条回答
女痞
2楼-- · 2020-03-07 07:41

That error message looks like it's coming from a proxy server. From the docker pull documentation

Proxy configuration

If you are behind an HTTP proxy server, for example in corporate settings, before open a connect to registry, you may need to configure the Docker daemon’s proxy settings, using the HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables. To set these environment variables on a host using systemd, refer to the control and configure Docker with systemd for variables configuration.

The link to the instructions for configuring systemd with a proxy is straightforward.

查看更多
在下西门庆
3楼-- · 2020-03-07 07:50

The error message is little misleading. The problem was not that there was invalid character, but the network was misconfigured. I had one LAN interface and one WLAN interface.

LAN interface connects to a router A which forward requests to router B which was connected to internet. While the WLAN interface was directly connected to router B. I forgot to remove the WLAN configuration.

Once I ensured the WLAN interface is removed, things worked smoothly.

In short: Ensured DNS resolution works and that MTU is set right

查看更多
登录 后发表回答