[英]Docker: Could not read CA certificate: no such file or directory
I'm on OSX and I've used docker-machine before, but now that there is a native Docker for Mac I wanted to install that.我在 OSX 上,我以前使用过 docker-machine,但现在有一个适用于 Mac的本机Docker,我想安装它。 So I uninstalled docker-machine using this uninstall script , and then I installed and started Docker for Mac without a problem.
所以我使用 这个卸载脚本卸载了 docker-machine,然后我安装并启动了 Docker for Mac 没有问题。
I can run docker --help
, which shows me all options as expected.我可以运行
docker --help
,它会按预期显示所有选项。
When I run docker ps
however, I get the following:但是,当我运行
docker ps
时,我得到以下信息:
$ docker ps Could not read CA certificate "/Users/kramer65/.docker/machine/machines/default/ca.pem": open /Users/kramer65/.docker/machine/machines/default/ca.pem: no such file or directory
$ docker ps 无法读取 CA 证书“/Users/kramer65/.docker/machine/machines/default/ca.pem”:打开/Users/kramer65/.docker/machine/machines/default/ca.pem:没有这样的文件或目录
I tried the solution from this answer (including sourcing the .bash_profile
to activate it), but that didn't solve anything.我尝试了这个答案中的解决方案(包括采购
.bash_profile
来激活它),但这并没有解决任何问题。
Does anybody know what I can do to solve this?有谁知道我能做些什么来解决这个问题?
Please remove your old docker-machine请移除旧的 docker-machine
then, edit your .bashrc .profile or .zshrc (whatever you use) and remove anything that exports DOCKER env variables (like socket, host, port and so on).然后,编辑您的 .bashrc .profile 或 .zshrc(无论您使用什么)并删除任何导出 DOCKER 环境变量的内容(如套接字、主机、端口等)。
Restart your shell at least, you can restart your Mac.至少重启你的shell,你可以重启你的Mac。 When you do
当你做
env | grep DOCKER
You should see nothing.你应该什么都看不到。
docker ps
should now work flawlessly. docker ps
现在应该可以正常工作了。
Background: The problem is that the old dockertoolbox
defines a custom host/port and puts that into your bashrc and does not remove it after uninstallation.背景:问题在于旧的
dockertoolbox
定义了一个自定义主机/端口并将其放入您的 bashrc 中,并且在卸载后不会将其删除。
docker for mac uses the Unix default socket, but it will not get picked up until you remove those old ENV variables docker for mac 使用 Unix 默认套接字,但在您删除那些旧的 ENV 变量之前它不会被拾取
在 PowerShell 中运行这些命令并重新打开: [Environment]::SetEnvironmentVariable("DOCKER_CERT_PATH", $null, "User") [Environment]::SetEnvironmentVariable("DOCKER_HOST", $null, "User") [Environment]: :SetEnvironmentVariable("DOCKER_MACHINE_NAME", $null, "User") [Environment]::SetEnvironmentVariable("DOCKER_TLS_VERIFY", $null, "User") [Environment]::SetEnvironmentVariable("DOCKER_TOOLBOX_INSTALL_PATH")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.