是否为使用 docker-machine 创建的 docker 守护程序配置 --allow-insecure-ssl。
命令:
docker-machine create --driver virtualbox dev
eval "$(docker-machine env dev)"
docker run myregistry:5000/busybox:latest echo 'hello world'
输出:
Unable to find image 'myregistry:5000/busybox:latest' locally
2015/06/04 16:54:17 Error: v1 ping attempt failed with error: Get
https://myregistry:5000/v1/_ping: EOF. If this private
registry supports only HTTP or HTTPS with an unknown CA certificate,
please add `--insecure-registry myregistry:5000` to the
daemon's arguments. In the case of HTTPS, if you have access to the
registry's CA certificate, no need for the flag; simply place the CA
certificate at /etc/docker/certs.d/myregistry:5000/ca.crt
最佳答案
如果您正在运行 docker-machine version v0.2 stable,则不能以轻量级方式设置 docker 选项。但是在下一个版本 v0.3 中,这个问题通过创建参数得到了解决。
目前这个功能在RC1上,那么你可以使用一个版本v0.3.0-RC-1或者等待下一个稳定版本v0.3.0(暂定6月16日)交付。
然后使用参数--engine-insecure-registry
为docker的守护进程设置--allow-insecure-ssl
,例如:
docker-machine create --driver virtualbox --engine-insecure-registry myregistry:5000 dev
之后就可以执行了:
docker run myregistry:5000/busybox:latest echo 'hello world'
此外,您可以在 project doc 上阅读有关它的信息。 .
关于docker - 允许在使用 docker-machine 配置的主机中进行不安全的注册表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30654306/