gpt4 book ai didi

python - 无法在 docker build 上安装位于私有(private) Nexus 存储库中的 Python 包

转载 作者:行者123 更新时间:2023-12-02 19:22:20 24 4
gpt4 key购买 nike

我有一个使用 Nexus 的私有(private) PyPi 注册表。我可以毫无问题地从我的主机发布/安装(我的个人包以及通过 PyPi nexus 代理的公共(public)包)。当我尝试使用 Dockerfile 构建 docker 镜像时,它允许我既不安装我自己的包也不通过 nexus 代理注册表安装公共(public)包(但我仍然可以从公共(public)公共(public)注册表安装公共(public)包 https://pypi.org/)。

Dockerfile(部分)

RUN pypy3 -m pip install --index-url https://username:password@host/repository/pypi-proxy/ flask
RUN pypy3 -m pip install --index-url https://username:password@host/repository/pypi-private/ my

错误

Collecting flask
ERROR: Could not find a version that satisfies the requirement flask (from versions: none)
ERROR: No matching distribution found for flask

我发现 DNS 有问题,但我可以从 https://pypi.org/ 安装,所以事实并非如此。

最佳答案

index-url 变量中指定的 URL 是存储库 URL 而不是索引 URL。每https://help.sonatype.com/display/NXRM3/PyPI+Repositories#PyPIRepositories-ConfiguringPyPIClientTools ,索引 URL 似乎以 /simple 结尾。

关于python - 无法在 docker build 上安装位于私有(private) Nexus 存储库中的 Python 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58757072/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com