适用于Windows的Docker SSL证书 [英] Docker SSL Cert for windows

查看:789
本文介绍了适用于Windows的Docker SSL证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将docker映像发布到私有存储库,但是我无法弄清楚应该在Windows机器上放置SSL证书的位置。

I am trying to publish a docker image to a private repository, but I cannot figure out where I am suppose to place the SSL cert on a Windows machine.

根据此页面 https:/ /docs.docker.com/engine/security/certificates/ 该证书应该放在/etc/docker/certs.d/HOSTNAME目录中。这显然不是Windows路径。但是,当我运行docker终端并键入cd / etc时,它确实将我带到了工作目录。

According to this page https://docs.docker.com/engine/security/certificates/ the cert is supposed to go in the /etc/docker/certs.d/HOSTNAME directory. This is clearly not a Windows path. However when I run the docker terminal and I type cd /etc it does take me to a working directory.

经过一番调查,我发现它要进入C:\Program Files\Git\etc,所以我创建了一个docker\certs.d\docker。该路径下的-registry.lan(docker-registry.lan是我们的内部注册表)目录。然后我用docker-machine stop,docker-machine start命令重新启动docker机器。

After some investigation I discovered it was going to C:\Program Files\Git\etc, So I created a docker\certs.d\docker-registry.lan (docker-registry.lan is our internal registry) directory under that path. Then I restart docker machine with a docker-machine stop, docker-machine start commands.

但是,当我尝试推送时,出现错误消息x509:证书已签名通过未知权限

However when I try a push I am getting an error that says x509: certificate signed by unknown authority

此密钥对于通过linux进行此操作的其他人很好,所以我知道该密钥是好的。我相信问题是我没有将密钥存储在正确的位置。

This key works fine for others that are doing this through linux so I know the key is fine. I believe the problem is that I am not storing the key in the correct location.

我已经尝试了很多不同的密钥来用,但是似乎都不起作用。这必须是我不容易解决的问题。

I have tried a bunch of different loactions for the key, but none seems to work. This has to be an easy fix that I am missing. Can someone who has solved this help me?

谢谢

推荐答案

如果您在Windows上本地运行Docker守护程序,则正确位置为 C:\ProgramData\docker\certs.d\myregistrydomain.com5000\ca.crt 。此处的详细信息: https://github.com/docker/docker/issues/21189# issuecomment-234997515

If you're running Docker daemon natively on Windows, the correct location is C:\ProgramData\docker\certs.d\myregistrydomain.com5000\ca.crt. Details here: https://github.com/docker/docker/issues/21189#issuecomment-234997515

这篇关于适用于Windows的Docker SSL证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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