大网数据广告活动
服务器运维问答

Private Docker Registry (with TLS certificate)

· 52CE 我爱测

I'm trying to setup a private docker registry based on the documentation of https://docs.docker.com/registry/deploying/#running-a-domain-registry . I'm using StartSSL as certificate issuer, downloaded their intermediate crt's and…

问题原文

原帖链接 · Martin Ahrer · CC BY-SA 3.0

I'm trying to setup a private docker registry based on the documentation of https://docs.docker.com/registry/deploying/#running-a-domain-registry.

I'm using StartSSL as certificate issuer, downloaded their intermediate crt's and combined them with my client certificate:

cd certs    
cat sca.server3.crt ca.crt client.pem  > client.crt

After starting the registry with

docker run --rm -p 5000:5000 --name registry -v `pwd`/certs:/certs -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/client.crt -e REGISTRY_HTTP_TLS_KEY=/certs/private.key registry:2

the registry complains about mismatching private/public key. However the very same certificate + private key works in some other Apache site. I didn't get that error before I had added the intermediate crt's to the client.crt

time="2016-07-18T11:34:19Z" level=fatal msg="crypto/tls: private key does not match public key"

As the registry is running inside an intranet (not public internet) I don't want to setup an apache/nginx just to act as proxy.

Sidenote: I'm using Docker Mac (Docker version 1.12.0-rc4, build e4a0dbc, experimental).

已采纳解答

原帖链接 · Vad1mo · CC BY-SA 3.0

As I remeber the order on how you combine your certificates is important.

try the bottom up approach:

cat domain.crt intermediate-certificates.pem ca.pem > chained-domain.crt

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-07-18)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。