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
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.
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"
]
This is accessed throught he docker icon -> preferences
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
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
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.
]
}