Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker config file location on windows to, e.g., enable insecure registry / docker options

Tags:

I want to add an insecure-registry for testing purposed on a Windows (10) machine for docker. Unfortunately I was not able to find any information where the usual /etc/docker/default config file is located on Windows.

Is here anyone who was able to add docker options on windows ?

Cheers.

(The error you get when trying to pull from an insecure registry without adding it to the options is: "Failed to tls handshake with x.x.x.x cannot validate certificate for x.x.x.x because it doesn't contain any IP SANs")

update1

I did find a way which looks promising:

  1. edit C:/Users/Username/.docker/machine/default/config.json
  2. add the registry : "InsecureRegistry": ["x.x.x.x:port"]
  3. restart docker with (?) docker-machine.exe restart default

but now I get this error: "Get https://x.x.x.x:port/v1/_ping: x509: cannot validate certificate for x.x.x.x because it doesn't contain any IP SANs"

(https://akrambenaissi.com/2015/11/17/addingediting-insecure-registry-to-docker-machine-afterwards/)

update2

After restarting Windows it worked:

  • I received "unauthorized: authentication required"
  • thus > docker login x.x.x.x:port and now it's working!
like image 252
hb0 Avatar asked May 09 '16 09:05

hb0


People also ask

Where is the docker config file on Windows?

The configuration file can be found at 'C:\ProgramData\Docker\config\daemon. json'. You can create this file if it doesn't already exist. Not every available Docker configuration option applies to Docker on Windows.

Where is docker registry config file?

Configure Docker Private Registry The default configuration file for the private registry can be found in /etc/registry/config. yml.

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.


1 Answers

The following worked for me:

  1. edit C:/Users/Username/.docker/machine/default/config.json
  2. add the registry : "InsecureRegistry": ["x.x.x.x:port"]
  3. restart docker (see comment below)*
  4. restart windows (there must be a better way ;-)
  5. docker login x.x.x.x:port
like image 152
hb0 Avatar answered Oct 12 '22 03:10

hb0