Trần văn Toán
Trần văn Toán

Reputation: 21

How can I resolve “server gave HTTP response to HTTPS client”

I have three servers:

1 master: 192.168.1.131 k8s
1 node: 192.168.1.132 k8s
1 rancher: 192.168.1.133 rancher 2.6

I have created a docker image (private registry docker) on the node used 192.168.1.132:5000/test. Both master and node pushed and pulled to the image. But used rancher deploy set image 192.168.1.132:5000/test then error:

Failed to pull image “192.168.1.132:5000/test-demo”: rpc error: code = Unknown desc = failed to pull and unpack image “192.168.1.132:5000/test-demo:latest”: failed to resolve reference “192.168.1.132:5000/test-demo:latest”: failed to do request: Head “https://192.168.1.132:5000/v2/test-demo/manifests/latest”: http: server gave HTTP response to HTTPS client.

My image used http not https. But the rancher sends HTTPS. This is image problem

Upvotes: 1

Views: 17958

Answers (2)

Omid N
Omid N

Reputation: 1035

On Unix-like operating systems. In addition to adding the insecure-registries to /etc/docker/daemon.json as below:

"insecure-registries": [
    "192.168.1.132:5000"
]

You have to add your user to the docker group as well:

sudo groupadd docker
sudo usermod -aG docker $USER

Then you have to logout and login again (Or even restart if you're on a virtual machine).

Ref: https://docs.docker.com/engine/install/linux-postinstall/

Upvotes: 1

Subarata Talukder
Subarata Talukder

Reputation: 6331

You may try this out by adding one line to the daemon.json file

The configuration file can be found at 'C:\ProgramData\Docker\config\daemon.json'. You can create this file if it doesn't already exist.

"insecure-registries": [
    "192.168.1.132:5000"
]

Then restart the docker service hope solves the issue.

Raff:

  1. Configure the Docker daemon
  2. Configure Docker with a configuration file.

Upvotes: 4

Related Questions