简体   繁体   English

Docker:无法读取 CA 证书:没有这样的文件或目录

[英]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.

相关问题 尝试启动docker时不断获取无法读取CA证书 - Keep getting Could not read CA certificate when trying to start docker SSL:无法加载CA证书文件/etc/pki/tls/certs/ca-bundle.crt - SSL: can't load CA certificate file /etc/pki/tls/certs/ca-bundle.crt psql:无法连接到服务器:没有这样的文件或目录 - psql: could not connect to server: No such file or directory Docker on MacOs Errno::ENOENT: 没有这样的文件或目录 - getcwd - Docker on MacOs Errno::ENOENT: No such file or directory - getcwd 无法读取opensslv.h:无此文件或目录 - unable to read opensslv.h:No such file or directory 在OSX 10.5.8上的Qt:“为此目的不信任根CA证书” - Qt on OSX 10.5.8: “The root CA certificate is not trusted for this purpose” 使用NSURLConnection的应用程序的iPhone自定义CA证书? - iPhone Custom CA certificate for an application which uses NSURLConnection? psql:无法连接到服务器:没有这样的文件或目录(Mac OS X) - psql: could not connect to server: No such file or directory (Mac OS X) psql:无法连接到服务器:MAC OSX上没有这样的文件或目录 - psql: could not connect to server: No such file or directory on MAC OSX OS X Docker“在提取状态之前重命名目录”的解决方法 - Workaround for OS X Docker 'Directory renamed before its status could be extracted'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM