Docker config file location on windows to, e.g., enable insecure registry / docker options
Solution 1
The following worked for me:
- edit C:/Users/Username/.docker/machine/default/config.json
- add the registry : "InsecureRegistry": ["x.x.x.x:port"]
- restart docker (see comment below)*
- restart windows (there must be a better way ;-)
- docker login x.x.x.x:port
Solution 2
After restarting my computer after changing config.json, I still wasn't able to connect to our insecure registry. I am using a self-named docker-machine (so, not default), maybe that has something to do with it. What did work was, after changing config.json and restarting the docker-machine (not my computer), executing the docker-machine regenerate-certs [machinename] command.
Before that command, 'docker info' did not mention the new registry, after regenerating the certs it did.
![hb0](https://i.stack.imgur.com/pNQA7.png?s=256&g=1)
hb0
Updated on July 09, 2022Comments
-
hb0 almost 2 years
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:
- edit C:/Users/Username/.docker/machine/default/config.json
- add the registry : "InsecureRegistry": ["x.x.x.x:port"]
- 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!