How to set registry mirror for docker toolbox in windows

Viewed 4446

I found a file called com.docker.service.config under C:\Program Files\Docker\Docker. How to configure the registry mirror inside this file? The file is in XML format as follows:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/>
    </startup>
</configuration>

Can't find any documentation on docker official website, can anyone shed some light? Thanks.

3 Answers

Found the solution unintentionally:

Open C:\Users\<YourName>\.docker\daemon.json, edit the "registry-mirrors" entry in that file.

enter image description here

{"registry-mirrors":["https://registry.docker-cn.com"],"insecure-registries":[], "debug":true, "experimental": true}

docker-machine ssh default
sudo sed -i "s|EXTRA_ARGS='|EXTRA_ARGS='--registry-mirror=https://registry.docker-cn.com |g" /var/lib/boot2docker/profile
exit
docker-machine restart default 

See this.

For windows version not equal to 10, if you are using docker toolbox, you can find the daemon settings under: C:\Users[username].docker\machine\machines\default\config.json but the settings names differ slightly from daemon.json windows 10.

Related