当前位置:   article > 正文

通过Docker-py调用Docker API出现报错 Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。_docker requests.exceptions.connectionerror: httpco

docker requests.exceptions.connectionerror: httpconnectionpool
  1. from django.test import TestCase
  2. import docker
  3. import django
  4. import requests
  5. requests.adapters.DEFAULT_RETRIES = 5
  6. s = requests.session()
  7. s.keep_alive = False
  8. print(django.get_version())
  9. # Create your tests here.
  10. docker.version_info
  11. client = docker.APIClient(base_url='tcp://xx.xx.xx.xx:2375')
  12. print(client.version())
  13. print(client.info())

报错信息如下:

requests.exceptions.ConnectionError: HTTPConnectionPool(host=' x.x.x.x ', port=2375): Max retries exceeded with url: /v1.35/version (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object 
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/175755
推荐阅读
相关标签
  

闽ICP备14008679号