【问题标题】:docker python package 4.3.1 not working with Docker Desktop 4.12.0 on Windows 10docker python package 4.3.1 在 Windows 10 上不能与 Docker Desktop 4.12.0 一起使用
【发布时间】:2022-11-06 21:34:36
【问题描述】:

我正在执行的错误容器.exec_run()方法,当升级到 Docker Desktop 4.12.0 时:

out = self.container.exec_run(命令,用户=用户,demux=demux,环境=环境,workdir=workdir) 文件“C:\test-proj\build_en\lib\site-packages\docker\models\containers.py”,第 198 行,在 exec_run exec_output = self.client.api.exec_start( 文件“C:\test-proj\build_en\lib\site-packages\docker\utils\decorators.py”,第 19 行,已包装 返回 f(self, resource_id, *args, **kwargs) 文件“C:\test-proj\build_en\lib\site-packages\docker\api\exec_api.py”,第 169 行,在 exec_start return self._read_from_socket(res, stream, tty=tty, demux=demux) 文件“C:\test-proj\build_en\lib\site-packages\docker\api\client.py”,第 413 行,在read_from_socket 返回消费套接字输出(gen,demux=demux) 文件“C:\test-proj\build_en\lib\site-packages\docker\utils\socket.py”,第 137 行,在 consume_socket_output 返回六.binary_type().join(帧) 文件“C:\test-proj\build_en\lib\site-packages\docker\api\client.py”,第 407 行,在 gen =(数据为(, 数据) 在 gen) 文件“C:\test-proj\build_en\lib\site-packages\docker\utils\socket.py”,第 94 行,在 frames_iter_no_tty (stream, n) = next_frame_header(socket) 文件“C:\test-proj\build_en\lib\site-packages\docker\utils\socket.py”,第 66 行,在 next_frame_header 数据 = read_exactly(socket, 8) 文件“C:\test-proj\build_en\lib\site-packages\docker\utils\socket.py”,第 51 行,在 read_exactly next_data = 读取(套接字,n - len(数据)) 文件“C:\test-proj\build_en\lib\site-packages\docker\utils\socket.py”,第 35 行,已读取 返回 socket.recv(n) 文件“C:\test-proj\build_en\lib\site-packages\docker\transport\npipesocket.py”,第 23 行,已包装 返回 f(self, *args, **kwargs) 文件“C:\test-proj\build_en\lib\site-packages\docker\transport\npipesocket.py”,第 117 行,在 recv 错误,数据 = win32file.ReadFile(self._handle, bufsize)pywintypes.error: (109, 'ReadFile', '管道已结束。')

【问题讨论】:

  • github.com/docker/docker-py/issues/3045 已针对此问题提出。出于兴趣,您正在运行哪个版本的 Python?
  • 我可以在旧版 Python 2.7 环境(Docker Python 4.4.4)中重现这一点,但使用 Python 3+Docker Python 4.1.0 它可以正常工作。
  • 我正在使用 python 3.9.2

标签: python docker


【解决方案1】:

找出问题所在 - 似乎是由于安装了最新的 docker 桌面。如果我从 4.12.0 降级到 4.11.1,则不再出现错误。

对于降级,我已经从控制面板卸载并安装了从https://docs.docker.com/desktop/release-notes/#docker-desktop-4111下载的4.11.1版本

【讨论】:

  • 可以确认降级有效。什么狗屁节目……
【解决方案2】:

对我来说,python docker SDK 6.0.1 的发布解决了这些问题 https://github.com/docker/docker-py/releases/tag/6.0.1 升级到此版本后,问题得到解决。 现在一切都适用于 docker 4.13.1

【讨论】:

    猜你喜欢
    • 2020-10-04
    • 2021-11-20
    • 2022-11-21
    • 2020-12-10
    • 1970-01-01
    • 2020-10-24
    • 1970-01-01
    • 1970-01-01
    • 2020-10-07
    相关资源
    最近更新 更多