Where should I set the '--insecure-registry' flag on Mac OS?

后端 未结 7 2366
野的像风
野的像风 2020-12-04 14:25

I am using OS X 10.10. When trying to communicate with our team\'s private docker registry, it keeps giving me errors like this:

Error: Invalid registry endp         


        
相关标签:
7条回答
  • 2020-12-04 14:55

    I was looking for a way to set --insecure-registry in Docker for Mac. Turned out to be simpler than what I first thought...

    Click the Docker icon in the tray to open Preferences. Click on the Daemon tab and add your insecure registries in Insecure registries section.

    Don't forget to Apply & Restart and you're ready to go.

    0 讨论(0)
  • 2020-12-04 14:55

    As of Docker 2.3.0.3, it must be in host:port format, i.e you have to remove http/https. Sample configuration

    "insecure-registries": [
        "registry.com:443",
        "registry-2.net:80"
      ]
    
    0 讨论(0)
  • 2020-12-04 14:55

    Working MacOS Big Sur

    This is accessed throught he docker icon -> preferences

    0 讨论(0)
  • 2020-12-04 14:58

    You have to set it to Docker Machine's / Boot2Docker profile file: docker-machine ssh <machine name>

    /var/lib/boot2docker/profile

    EXTRA_ARGS='
    --label provider=virtualbox --insecure-registry myregistry:5000
    
    '
    

    And then restart Docker service.

    sudo /etc/init.d/docker restart
    
    0 讨论(0)
  • 2020-12-04 15:03

    The proper way to set it is via the --engine-insecure-registry argument to docker-machine:

    docker-machine create --driver virtualbox \
      --engine-insecure-registry myregistry:5000 dev
    

    You can also pass other options using --engine-opts. For example, set dns via --engine-opt dns=8.8.8.8

    This essentially ends up setting EXTRA_ARGS in /var/lib/boot2docker/profile

    0 讨论(0)
  • 2020-12-04 15:09

    Mac docker's config file was in ~/.docker/daemon, The configuration you added to the software interface is the wrong configuration for the MAC,because it's an extra "," like this.

        {
        "insecure-registries" : [
            "XXXX:5000", \\ <-- THIS ","
          ],
          "registry-mirrors" : [
            "https://registry.docker-cn.com", \\ <--  THIS ","
          ]
        }
    

    The right config is

        "insecure-registries" : [
            "XXXX:5000"  \\ there is no comma, it is working.
          ],
          "registry-mirrors" : [
            "https://registry.docker-cn.com" \\ there is no comma, it is working.
          ]
        }
    
    0 讨论(0)
提交回复
热议问题