공식 문서에 따라 CentOS 7 상자에 Docker 개인 레지스트리 (v2)를 설정했습니다. https://docs.docker.com/registry/deploying/
Fedora 21 상자에서 docker 1.6.0을 실행하고 있습니다.
레지스트리는 포트 5000에서 실행 중이며 신뢰할 수있는 CA에서 서명 한 SSL 키를 사용하고 있습니다. 'docker-registry.example.com'에 대한 DNS 레코드를 서버의 내부 IP로 설정했습니다. 'docker pull docker-registry.example.com:5000/tag/image'를 실행하면 예상대로 작동합니다.
nginx 버전 : nginx / 1.8.0을 실행하는 nginx 서버를 설정하고 nginx 서버를 가리키는 'nginx-proxy.example.com'에 대한 DNS 레코드를 설정하고 사이트를 설정합니다. 구성은 다음과 같습니다.
server {
listen 443 ssl;
server_name nginx-proxy.example.com;
add_header Docker-Distribution-Api-Version: registry/2.0 always;
ssl on;
ssl_certificate /etc/ssl/certs/cert.crt;
ssl_certificate_key /etc/ssl/certs/key.key;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Original-URI $request_uri;
proxy_set_header Docker-Distribution-Api-Version registry/2.0;
location / {
proxy_pass http://docker-registry.example.com:5000;
}
}
'docker pull nginx-proxy.example.com/tag/image'를 실행하려고하면 다음 오류가 발생합니다.
FATA[0001] Error response from daemon: v1 ping attempt failed with error: Get https://nginx-proxy.example.com/v1/_ping: malformed HTTP response "\x15\x03\x01\x00\x02\x02"
내 질문은 두 가지입니다.
'curl -v nginx-proxy.example.com/v2'를 실행하면 다음과 같이 표시됩니다.
[root@alex amerenda] $ curl -v https://nginx-proxy.example.com/v2/
* Hostname was NOT found in DNS cache
* Trying 10.1.43.165...
* Connected to nginx-proxy.example.com (10.1.43.165) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* SSL connection using TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate:
* subject: CN=*.example.com,O="example, Inc.",L=New York,ST=New York,C=US
* start date: Sep 15 00:00:00 2014 GMT
* expire date: Sep 15 23:59:59 2015 GMT
* common name: *.example.com
* issuer: CN=GeoTrust SSL CA - G2,O=GeoTrust Inc.,C=US
> GET /v2/ HTTP/1.1
> User-Agent: curl/7.37.0
> Host: nginx-proxy.example.com
> Accept: */*
> \x15\x03\x01\x00\x02\x02
'curl -v docker-registry.example.com'을 수행하면 200 OK 응답을받습니다. 따라서 nginx가이를 책임 져야합니다. 왜 이런 일이 일어나는지 아는 사람이 있습니까? 그것은 나를 미치게 만든다!
proxy_pass http://docker-registry.example.com:5000;
일반 HTTP (예 : https 없음)로 요청을 전달하고 있습니다.
\ x15 \ x03 \ x01 \ x00 \ x02 \ x02
그리고 SSL 응답을 받고 있습니다. 따라서 포트 5000에 액세스하려면 http : //가 아닌 https : //를 사용해야하는 것 같습니다. SSL을 사용하고 있다는 것도 알고 있습니다.
레지스트리는 포트 5000에서 실행 중이며 신뢰할 수있는 CA에서 서명 한 SSL 키를 사용하고 있습니다.
그 외에 : example.com과 같은 예를 위해 예약 된 이름을 사용하고 귀하의 예에 속하지 않는 도메인 이름을 사용하지 마십시오.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다