DOCKER_TLS_VERIFY和DOCKER_CERT_PATH变量有什么作用? [英] What does the DOCKER_TLS_VERIFY and DOCKER_CERT_PATH variable do?

查看:549
本文介绍了DOCKER_TLS_VERIFY和DOCKER_CERT_PATH变量有什么作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Docker的新手,在Windows 7上使用boot2docker.
当我尝试通过spotify maven插件配置Docker构建时,要求我在下面设置env变量:

I am new to Docker, using boot2docker on Windows 7.
While I was trying to configure Docker build through spotify maven plugin, I was asked to set below env variables :

DOCKER_HOST
DOCKER_CERT_PATH
DOCKER_TLS_VERIFY

配置成功,但不确定 DOCKER_TLS_VERIFYDOCKER_CERT_PATH变量有什么作用?

Configuration was successful but am not sure What does the DOCKER_TLS_VERIFY and DOCKER_CERT_PATH variables do ?

推荐答案

:

As mentioned in the README:

默认情况下,boot2docker在启用TLS的情况下运行docker .它会自动生成证书并将其存储在VM内的/home/docker/.docker中.
VM启动后,boot2docker up命令会将它们复制到主机上的~/.boot2docker/certs,并为DOCKER_CERT_PATHDOCKER_TLS_VERIFY环境变量输出正确的值.

By default, boot2docker runs docker with TLS enabled. It auto-generates certificates and stores them in /home/docker/.docker inside the VM.
The boot2docker up command will copy them to ~/.boot2docker/certs on the host machine once the VM has started, and output the correct values for the DOCKER_CERT_PATH and DOCKER_TLS_VERIFY environment variables.

eval "$(boot2docker shellinit)" will also set them correctly.

出于安全原因,我们强烈建议不要使用未加密的Docker套接字运行Boot2Docker,但是,如果您拥有无法轻松切换的工具,则可以通过在/var/lib/boot2docker/profile文件中添加DOCKER_TLS=no来禁用它.

We strongly recommend against running Boot2Docker with an unencrypted Docker socket for security reasons, but if you have tools that cannot be easily switched, you can disable it by adding DOCKER_TLS=no to your /var/lib/boot2docker/profile file.

在更动态的环境中,boot2docker ip可以更改,请参见问题944

In a more dynamic environment, where the boot2docker ip can change, see issue 944.

这篇关于DOCKER_TLS_VERIFY和DOCKER_CERT_PATH变量有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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