Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

docker

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 endpoint https://registry.xxx.xxx/v1/: Get https://registry.af-sys.com/v1/_ping: dial tcp xx.xxx.xxx.xxx:xxx: i/o timeout. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add --insecure-registry... 

On Ubuntu system this error can be resolved by adding DOCKER_OPTS into the /etc/default/docker configuration file like this:

DOCKER_OPTS="$DOCKER_OPTS --insecure-registry myregistry:5000" 

Does Mac OS have a similar configuration file where I can add the DOCKER_OPTS option?

like image 849
mainframer Avatar asked Sep 27 '15 13:09

mainframer


People also ask

How do I add an insecure registry to Minikube?

Enabling Insecure Registries minikube allows users to configure the docker engine's --insecure-registry flag. You can use the --insecure-registry flag on the minikube start command to enable insecure communication between the docker engine and registries listening to requests from the CIDR range.

Which options configure the docker daemon to connect to a registry?

In a typical setup where you run your Registry from the official image, you can specify a configuration variable from the environment by passing -e arguments to your docker run stanza or from within a Dockerfile using the ENV instruction. This variable overrides the /var/lib/registry value to the /somewhere directory.


2 Answers

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

In the Docker Desktop application :

  1. click on the Settings icon
  2. select Docker Engine menu entry
  3. add your insecure registries

how to set docker --insecure-registry on mac os x

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

like image 187
Pierre-Alexis de Solminihac Avatar answered Sep 19 '22 17:09

Pierre-Alexis de Solminihac


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 
like image 41
Lauri Avatar answered Sep 23 '22 17:09

Lauri