This is a solution for both: Linux and Windows.

You maybe came across this error pushing or pulling to/from a local registry, like Nexus or others.

The problem is that Docker is trying to use HTTPS protocol but your registry does not support it, it accepts only HTTP connection.

We need to say to Docker that this is an our registry and he can trust it.

Linux / Windows server

Edit the daemon.json file, whose default location is /etc/docker/daemon.json.

If the daemon.json file does not exist, create it. Assuming there are no other settings in the file, it should have the following contents:

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

Substitute the address (myregistry:5000) with your insecure registry.

Restart docker daemon sudo service docker restart

Docker desktop

If you use Docker Desktop for Mac or Docker Desktop for Windows, click the Docker icon, choose Preferences, and choose Daemon Engine.

Add your insecure registry as screen below, then click "Apply & Restart".

Docker site source: