Configuration 如何在“从”启动docker时添加“--registry mirror”;Docker quickstart终端“;?

Configuration 如何在“从”启动docker时添加“--registry mirror”;Docker quickstart终端“;?,configuration,proxy,docker,mirror,Configuration,Proxy,Docker,Mirror,从docker分发文档: 它说要配置docker使用镜像,我们应该: Configuring the Docker daemon You will need to pass the --registry-mirror option to your Docker daemon on startup: docker --registry-mirror=https://<my-docker-mirror-host> daemon 我可以将'--registry mirror'配置放入

从docker分发文档:

它说要配置docker使用镜像,我们应该:

Configuring the Docker daemon

You will need to pass the --registry-mirror option to your Docker daemon on startup:

docker --registry-mirror=https://<my-docker-mirror-host> daemon

我可以将'--registry mirror'配置放入的文件是否正确?我该怎么办?

如果您使用
docker机器创建--help

docker-machine create --help
Usage: docker-machine create [OPTIONS] [arg...]

Create a machine.

Run 'docker-machine create --driver name' to include the create flags for that driver in the help text.

Options:
...
   --engine-insecure-registry [--engine-insecure-registry option --engine-insecure-registry option]     Specify insecure registries to allow with the created en
gine
   --engine-registry-mirror [--engine-registry-mirror option --engine-registry-mirror option]           Specify registry mirrors to use
因此,您可以修改脚本以添加更多参数:

--engine-registry-mirror=...
但是,由于“
default
”docker机器可能已经存在(请执行
docker机器ls
),您可能需要首先删除它(
docker机器rm default
:确保您可以轻松地从本地docker文件重新创建图像,并且/或者您没有需要首先保存的数据容器)

打开
C:\Users\\\.docker\daemon.json
,编辑该文件中的“注册表镜像”项


{“注册表镜像”:[“https://registry.docker-cn.com“],“不安全的注册表”:[],“调试”:真,“实验”:真}
是否可以更新默认机器使用的注册表,而不必(重新)创建一个新的?@Alexis.Rolland 5年后,我不是太usre:这本身就是一个好问题。
--engine-registry-mirror=...