首页 > 解决方案 > 使用 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 上运行,因此那里可能存在一些路由问题,但我看不到那里有任何问题。谢谢!

标签: pythondockergoogle-cloud-platform

解决方案


正如@Pavel Zagalsky 所证实的那样,Docker API for Python 没有问题:

问题是我用来运行代码的虚拟机映像在启动脚本中有防火墙。


推荐阅读