作者 主題: docker trouble-shooting tips  (閱讀 5103 次)

0 會員 與 1 訪客 正在閱讀本文。

netman

  • 管理員
  • 俺是博士!
  • *****
  • 文章數: 17484
    • 檢視個人資料
    • http://www.study-area.org
docker trouble-shooting tips
« 於: 2017-05-12 17:16 »
Note down before forgetting:

* docker: behind proxy
create /etc/systemd/system/docker.service.d/http-proxy.conf with following contents:
代碼: [選擇]
[Service]

Environment="ALL_PROXY=socks://127.0.0.1:8080/" "FTP_PROXY=ftp://127.0.0.1:8080/" "HTTPS_PROXY=http://127.0.0.1:8080/" "HTTP_PROXY=http://127.0.0.1:8080/" "NO_PROXY=localhost,127.0.0.0/8,127.0.0.1/16,192.168.0.0./16" "all_proxy=socks://127.0.0.1:8080/" "ftp_proxy=ftp://127.0.0.1:8080/" "http_proxy=http://127.0.0.1:8080/" "https_proxy=http://127.0.0.1:8080/" "no_proxy=localhost,127.0.0.0/8,172.16.0.0/16,192.168.0.0./16"


* Dockerfile: run pip with specified proxy:
代碼: [選擇]
RUN https_proxy=http://127.0.0.1:8080/ pip install -r requirements.txt

* Dockerfile: encounter SSL certificate failed while run pip:
Could not fetch URL https://pypi.python.org/simple/flask/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed
- Solution:
add --trusted-host pypi.python.org in the pip command line:
代碼: [選擇]
RUN pip install --trusted-host pypi.python.org -r requirements.txt

* docker swarp: get folloing error while re-join a re-initiated swarn:
Error response from daemon: rpc error: code = 13 desc = connection error: desc = "transport: x509: certificate signed by unknown authority (possibly because of \"x509: ECDSA verification failure\" while trying to verify candidate authority certificate \"swarm-ca\")
- Solution:
    rm or mv the file swarm-root-ca.crt  in /var/lib/docker/swarm/certificates/