Error response from daemon: failed to do request: HTTPS request instead of HTTP

C:\Users\asus>docker info
Client:
 Version:    27.3.1
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.17.1-desktop.1
    Path:     C:\Users\asus\.docker\cli-plugins\docker-buildx.exe
  compose: Docker Compose (Docker Inc.)
    Version:  v2.29.7-desktop.1
    Path:     C:\Users\asus\.docker\cli-plugins\docker-compose.exe
  debug: Get a shell into any image or container (Docker Inc.)
    Version:  0.0.37
    Path:     C:\Users\asus\.docker\cli-plugins\docker-debug.exe
  desktop: Docker Desktop commands (Alpha) (Docker Inc.)
    Version:  v0.0.15
    Path:     C:\Users\asus\.docker\cli-plugins\docker-desktop.exe
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.2
    Path:     C:\Users\asus\.docker\cli-plugins\docker-dev.exe
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.27
    Path:     C:\Users\asus\.docker\cli-plugins\docker-extension.exe
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.5
    Path:     C:\Users\asus\.docker\cli-plugins\docker-feedback.exe
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.3.0
    Path:     C:\Users\asus\.docker\cli-plugins\docker-init.exe
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     C:\Users\asus\.docker\cli-plugins\docker-sbom.exe
  scout: Docker Scout (Docker Inc.)
    Version:  v1.14.0
    Path:     C:\Users\asus\.docker\cli-plugins\docker-scout.exe

Server:
 Containers: 2
  Running: 0
  Paused: 0
  Stopped: 2
 Images: 13
 Server Version: 27.3.1
 Storage Driver: overlayfs
  driver-type: io.containerd.snapshotter.v1
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 nvidia runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 472731909fa34bd7bc9c087e4c27943f9835f111
 runc version: v1.1.13-0-g58aa920
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
 Kernel Version: 5.15.153.1-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 15.24GiB
 Name: docker-desktop
 ID: 836f94b1-b38a-4af8-877b-d777fc0d3ab0
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Labels:
  com.docker.desktop.address=npipe://\\.\pipe\docker_cli
 Experimental: false
 Insecure Registries:
  172.16.238.79
  172.20.2.34:5000
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support
WARNING: daemon is not using the default seccomp profile
C:\Users\asus>docker pull 172.16.238.79/ahead4/node:16.16.0-alpine3.15
Error response from daemon: failed to resolve reference "172.16.238.79/ahead4/node:16.16.0-alpine3.15": failed to do request: Head "https://172.16.238.79/v2/ahead4/node/manifests/16.16.0-alpine3.15": EOF

As per the docker info output above, even though I have added 172.16.238.79 to the Insecure Registries list, Docker is still attempting to make an HTTPS request instead of HTTP when pulling an image from 172.16.238.79.

If I remember correctly, since insecure registry could also be a registry with self-signed certificate, the default is always HTTPS and if yoiu need HTTP, you need to start the include the protocol before the IP address when you add it to the insecure registries. So try to add http://172.16.238.79

After adding "insecure-registries": ["http://172.16.238.79"], requests are still sent over the HTTPS protocol.

Even when I try to use the command docker pull http://172.16.238.79/ahead4/node:16.16.0-alpine3.15, it still results in the error: “invalid reference format.”

It is HTTP in your quoted new URL, so it seems it tried HTTP too. I checked the documentation:

It says

  • First, try using HTTPS.
    • If HTTPS is available but the certificate is invalid, ignore the error about the certificate.
    • If HTTPS is not available, fall back to HTTP.

So HTTP should work even without adding the protocol, but the error message is actually saying

failed to do request: Head "...": EOF

So maybe there is a second issue.

What is the full message? Is it still the EOF? I guess it could also be an invalid response. I don’t know how. How did you install the registry? Did you use the simple docker image from Docker Hub based on the distribution project?

The second issue seems ignorable, as I manually added “http://” in the command line. However, adding “http://172.16.238.79” to “insecure-registries” Is it still the EOF

and its based on the distribution project

Then please, share the whole error message again, because small differences can matter. If it still redirects to HTTPS, then I don’t know. I used insecure registries long time ago and worked. But I have no idea whether it should work now or not. It should based on the documentation. But you could configure a self-signed certificate too and see if that works as insecure. I think I have done that more often. And sometimes I used LetsEncrypt through a proxy that was available through the internet using a domain which internally pointed to the private registry. For me, EOF looks like something that is not actually related to HTTPS, but if it is not, then something is either wrong with the registry or Docker inside Docker Desktop. Network issues often happened in Docker Desktop caused by proxies and other local configurations or maybe simply caused by a bug.

Maybe you can try Docker in a WSL distribution without Docker Desktop. OR have you tried the same registry from another machine which is not using Docker Desktop but Docker CE on Linux?

1 Like

The issue was resolved by following these steps:

  1. Go to Troubleshoot in the Docker settings.
  2. Click on Clean/Purge Data.
  3. Check the box for Windows Containers.
  4. Back to Troubleshoot and clickReset to Factory Defaults.
  5. After that, reconfigure the Insecure Registries.

This process should help reset Docker to a working state and address any issues with container configurations.