python - 使用 Docker API for Python 时出现“URL 超出最大重试次数:/v1.35/containers/create”错误
问题描述
我正在尝试使用 Python 的 Docker 包启动 docker 映像并收到以下错误:
Getting "Max retries exceeded with URL: /v1.35/containers/create" error when using the Docker API for Python
这是我运行的命令:
self.container = self.docker_connector_client.container_run\
(image="jenkins", version="latest", ports={'8080': '8081'})
Docker 守护进程在 VM 的 3389 端口上运行,我绝对可以看到它在那里运行。
当我运行 curl://localhost:3389 时,我看到了响应。但是来自其他任何地方的卷曲我得到一个错误。
虚拟机本身在 GCP 上运行,因此那里可能存在一些路由问题,但我看不到那里有任何问题。谢谢!
解决方案
正如@Pavel Zagalsky 所证实的那样,Docker API for Python 没有问题:
问题是我用来运行代码的虚拟机映像在启动脚本中有防火墙。
推荐阅读
- git - 如何向我的 Git GUI SmartGit 添加自定义路径?
- windows - 如果语句未按预期执行 - 批处理文件
- python - 如何在 tkinter ttk.button 中使用不同颜色为按钮着色?
- python - 添加到不带引号的python列表
- css - 如何用css反转wave svg?
- r - 将日期字符串转换为 R 中的天数
- android - 通过对话框将数据从适配器传递到活动
- c++ - 从 Select 调用返回后,在服务器上处理/重组 TCP 分段数据包的方法
- android-camerax - java.lang.IllegalArgumentException:建议的分辨率地图缺少相机 1 的分辨率
- r - R:将函数逐行应用于表,将查找表中的值作为参数传递