Failed to pull image from Docker local insecure registry: http: server gave HTTP response to HTTPS client

2/12/2020

when I try to deploy application in Kubernetes using images in my private Docker registry on same server (master node), I receive following error:

Failed to pull image "0.0.0.0:5000/continuous-delivery-tutorial:5ec98331a69ec5e6f818583d4506d361ff4de89b-2020-02-12-14-37-03": rpc error: code = Unknown desc = Error response from daemon: Get https://0.0.0.0:5000/v2/: http: server gave HTTP response to HTTPS client

When I print docker system info I can see there is my registry as insecure registry:

enter image description here

I run my registry by following command:

docker run -d -p 5000:5000 --restart=always --name registry -v $PWD/docker_reg_certs:/certs -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key registry:2

Thank you for any advice

-- Mariyo
docker
docker-registry
https
kubernetes

1 Answer

2/12/2020

you need to add your hostname to the list of allowed insecure registries in /etc/docker/daemon.json. for example:

{
  "insecure-registries" : ["your-computer-hostname:5000"]
}

also, you should not use 0.0.0.0 as it is not a real address. use your hostname instead when specifying image, like your-computer-hostname:5000/continuous-delivery-tutorial:5ec98331a69ec5e6f818583d4506d361ff4de89b-2020-02-12-14-37-03

-- morgwai
Source: StackOverflow