Git не может клонировать публичный репозиторий из контейнера Docker - PullRequest
0 голосов
/ 18 октября 2019

Я пытаюсь создать образ докера с помощью файла docker, который содержит следующую команду:

RUN GIT_CURL_VERBOSE=1 git clone --depth=1 -b  master https://code.aliyun.com/SmileYang/adaptive-loadbalance.git

Я получаю ошибку при создании образа докера:

 ---> Running in 89727fcab44a
+ GIT_CURL_VERBOSE=1 git clone --depth=1 -b master https://code.aliyun.com/SmileYang/adaptive-loadbalance.git
Cloning into 'adaptive-loadbalance'...
* Couldn't find host code.aliyun.com in the .netrc file; using defaults
*   Trying 120.55.150.20...
* TCP_NODELAY set
* Connected to code.aliyun.com (120.55.150.20) port 443 (#0)
* found 151 certificates in /etc/ssl/certs/ca-certificates.crt
* found 604 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* Operation timed out after 300014 milliseconds with 0 out of 0 bytes received
* Curl_http_done: called premature == 1
* stopped the pause stream!
* Closing connection 0
fatal: unable to access 'https://code.aliyun.com/SmileYang/adaptive-loadbalance.git/': Operation timed out after 300014 milliseconds with 0 out of 0 bytes received

Iпопробуйте выполнить команду git clone без докера, и я получу следующий вывод:

aijiaming@ubuntu:~$ GIT_CURL_VERBOSE=1 git clone --depth=1 -b master https://code.aliyun.com/SmileYang/adaptive-loadbalance.git
Cloning into 'adaptive-loadbalance'...
* Couldn't find host code.aliyun.com in the .netrc file; using defaults
*   Trying 120.55.150.20...
* Connected to code.aliyun.com (120.55.150.20) port 443 (#0)
* found 148 certificates in /etc/ssl/certs/ca-certificates.crt
* found 594 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
*        server certificate verification OK
*        server certificate status verification SKIPPED
*        common name: code.aliyun.com (matched)
*        server certificate expiration date OK
*        server certificate activation date OK
*        certificate public key: RSA
*        certificate version: #3
*        subject: C=CN,ST=ZheJiang,L=HangZhou,O=Alibaba (China) Technology Co.\, Ltd.,CN=code.aliyun.com
*        start date: Wed, 09 Oct 2019 02:01:07 GMT
*        expire date: Fri, 09 Oct 2020 02:01:07 GMT
*        issuer: C=BE,O=GlobalSign nv-sa,CN=GlobalSign Organization Validation CA - SHA256 - G2
*        compression: NULL
* ALPN, server accepted to use http/1.1
> GET /SmileYang/adaptive-loadbalance.git/info/refs?service=git-upload-pack HTTP/1.1

------------------more output-------------------------

Вот аналогичный вопрос:

Сбой git clone с тайм-аутом операции после 0миллисекунды с 0 из 0 полученных байтов

Я не знаю, почему он остановился на ALPN, offering http/1.1, похоже, что это проблема SSL .

git версия: 2.11.0

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...