我应该在Mac OS的哪里设置“ --insecure-registry”标志? [英] Where should I set the '--insecure-registry' flag on Mac OS?

查看:53
本文介绍了我应该在Mac OS的哪里设置“ --insecure-registry”标志?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用OS X 10.10。当尝试与我们团队的私有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...

在Ubuntu系统上,可以通过将 DOCKER_OPTS 添加到 / etc / default / docker中来解决此错误。 这样的配置文件:

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"

Mac OS是否具有类似的配置文件,我可以在其中添加 DOCKER_OPTS 选项?

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

推荐答案

您必须将其设置为Docker Machine的/ Boot2Docker配置文件:
docker-machine ssh<计算机名>

You have to set it to Docker Machine's / Boot2Docker profile file: docker-machine ssh <machine name>

/ var / lib / boot2docker / profile

/var/lib/boot2docker/profile

EXTRA_ARGS='
--label provider=virtualbox --insecure-registry myregistry:5000

'

然后重新启动Docker服务。

And then restart Docker service.

sudo /etc/init.d/docker restart

这篇关于我应该在Mac OS的哪里设置“ --insecure-registry”标志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆