a18*_*859 7 bitbucket docker docker-compose python-poetry
问题:\n我正在尝试使用 ssh 密钥作为 tool.poetry.dev.dependency 在我的 pyproject.toml 中添加 bitbucket 存储库,并通过 docker compose 将其安装在 docker 容器中。但是,我在构建容器时遇到以下错误(请参阅错误)。
\n在 Docker 容器中安装诗歌期间,有什么我可能会忽略的事情和/或建议能够将 bitbucket 存储库作为依赖项拉出吗?
\n我做了什么:
\n参考
\n错误:\nHangupException
\n远程服务器意外关闭了连接。
\n在 /usr/local/lib/python3.10/site-packages/dulwich/protocol.py:220 中 read_pkt_line
\n 216\xe2\x94\x82 \n 217\xe2\x94\x82 try:\n 218\xe2\x94\x82 sizestr = read(4)\n 219\xe2\x94\x82 if not sizestr:\n \xe2\x86\x92 220\xe2\x94\x82 raise HangupException()\n 221\xe2\x94\x82 size = int(sizestr, 16)\n 222\xe2\x94\x82 if size == 0:\n 223\xe2\x94\x82 if self.report_activity:\n 224\xe2\x94\x82 self.report_activity(4, "read")\nRun Code Online (Sandbox Code Playgroud)\n尝试处理此错误时发生以下错误:
\n挂断异常
\n主机密钥验证失败。
\n在 fetch_pack 中的 /usr/local/lib/python3.10/site-packages/dulwich/client.py:1151
\n 1147\xe2\x94\x82 with proto:\n 1148\xe2\x94\x82 try:\n 1149\xe2\x94\x82 refs, server_capabilities = read_pkt_refs(proto.read_pkt_seq())\n 1150\xe2\x94\x82 except HangupException as exc:\n \xe2\x86\x92 1151\xe2\x94\x82 raise _remote_error_from_stderr(stderr) from exc\n 1152\xe2\x94\x82 (\n 1153\xe2\x94\x82 negotiated_capabilities,\n 1154\xe2\x94\x82 symrefs,\n 1155\xe2\x94\x82 agent,\nRun Code Online (Sandbox Code Playgroud)\n我的文件/命令:\npyproject.toml
\n [tool.poetry.dependencies]\n\n # Trial 1: I am trying to use ssh key to pull to repo (see docker build command) [1]\n package_name = {git = "ssh://git@bitbucket.org/tenant/repo.git", tag = "v0.0.0"}\n\n # Trial 2: I don't really want to use http because I don't want to have to feed in credentials [1]\n package_name = {git = "https://user@bitbucket.org/tenant/repo.git", tag = "v0.0.0"}\n\n # Trial 3: I didn't know if it was just a bitbucket thing so I had also tried with git and it works locally just not in a docker container\n package_name = {git="git+ssh://git@github.com/user/repo.git"}`\n\nRun Code Online (Sandbox Code Playgroud)\nDockerfile
\n ENV POETRY_VERSION=1.2.2\n RUN pip install poetry==$POETRY_VERSION\n COPY ./poetry.lock ./pyproject.toml ./\n RUN poetry config installer.max-workers 4 \\\n && poetry install --no-root`\nRun Code Online (Sandbox Code Playgroud)\nDocker 构建命令
\n docker build --no-cache --ssh default -t $IMAGE_NAME .\nRun Code Online (Sandbox Code Playgroud)\nDocker 撰写命令
\n docker compose build\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
1294 次 |
| 最近记录: |