Docker repository server gave HTTP response to HTTPS client

后端 未结 6 1192
粉色の甜心
粉色の甜心 2021-02-05 02:09

I use Docker toolbox for windows and i`m trying run private docker registry from this documentation https://docs.docker.com/registry/deploying/

But it`s not work for me.

相关标签:
6条回答
  • 2021-02-05 02:31

    Hopefully this will help anyone having issues getting the insecure-registries fix to work.

    Adding

    { "insecure-registries":["host:port"] }

    to

    /etc/docker/daemon.json

    did not work for me until I created the file

    /etc/default/docker

    and put the line

    DOCKER_OPTS="--config-file=/etc/docker/daemon.json"

    in it and then restarted the docker daemon with

    sudo systemctl stop docker and sudo systemctl start docker.

    For some reason just doing a sudo systemctl restart docker did not work. It threw an error about trying to restart the service to quickly.

    Also for ["host:port"] I used the IP of my Docker registry as opposed to the hostname as I did not have DNS or a hosts file setup to be able to find the registry by hostname.

    This drove me absolutely nuts until I stumbled upon the /etc/default/docker bit here.

    I am new to Docker and so I don't know if this is new requirement since this initial post was answered or if there was something else I missed when I first setup my registry. Though all I did was to follow the current docs on the Docker site itself.

    0 讨论(0)
  • 2021-02-05 02:33

    On CentOS 7.2.1511, I had to create a new file

    /etc/docker/daemon.json 
    

    with the contents

    { "insecure-registries":["host:port"] } 
    

    (The host is the hostname of the server hosting my docker registry and port is the port where the docker registry is available. In my case, those are 192.168.99.1:50000)

    and then restart docker daemon by doing:

    $ sudo service docker restart
    
    0 讨论(0)
  • 2021-02-05 02:33

    If you are using Docker Desktop for Windows:

    • Click the docker whale icon in the task bar

    • A menu appears, click Settings

    • A popup appears, click Daemon

    • Entry your insecure registry in the "Insecure registries" text area

    • Click apply

    Job done, no need to manually edit any files

    0 讨论(0)
  • 2021-02-05 02:35

    If you use windows:

    1. in startup menu, right clic on docker desktop one, and select settings
    2. select "docker engine" tab, and change as in picture "insecure-registries": [], by "insecure-registries": ["192.168.99.1:5000"],

    1. Click apply and restart button
    2. After docker restart, to check that modification was applied, open cmd console and execute this command: docker system info then check that 192.168.99.1:5000 exists in "insecure-registries" section
    0 讨论(0)
  • 2021-02-05 02:51

    Looks like you haven't set the Docker Daemon right. Notice these few lines:

    Insecure Registries:
     127.0.0.0/8
    

    Try to add this line to Docker's daemon.json file and restart the Docker Daemon:

    "insecure-registries":["192.168.99.100:5000"]
    
    0 讨论(0)
  • 2021-02-05 02:58

    If you are using minikube in Windows machine along with minikube addons registry.

    1.Find the registry IP. It will be same as minikube IP.

    > minikube ip
    

    2.Edit the file:

    C:\Users\<username>\.minikube\machines\minikube\config.json
    
     "InsecureRegistry": [
                    "10.96.0.0/12",      // Add coma
                    "<minikube IP>:5000" //-> Add this line
                ],
    
    1. Restart minikube

      > minikube start

    0 讨论(0)
提交回复
热议问题