简体   繁体   English

无法安装 Python package 位于 docker 构建的私有 Nexus 存储库中

[英]Can't install Python package located in private Nexus repo on docker build

I have a private PyPi registry using Nexus.我有一个使用 Nexus 的私有 PyPi 注册表。 I can publish/install from my host machine without any problems (my personal packages as well as common packages via PyPi nexus proxy).我可以毫无问题地从我的主机发布/安装(我的个人包以及通过 PyPi nexus 代理的常见包)。 When I try to build a docker image using Dockerfile it allows me to install neither my own packages nor public through the nexus proxy registry (but I still can install public packages from common public registry https://pypi.org/ ).当我尝试使用 Dockerfile 构建 docker 映像时,它允许我既不安装我自己的包,也不通过 nexus 代理注册表安装公共包(但我仍然可以从公共公共注册表Z5E056C500A1C4B76A7118py.org/安装公共包)

Dockerfile (part) 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

Error错误

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

I saw issues with DNS but I can install from https://pypi.org/ so its not the case.我看到了 DNS 的问题,但我可以从https://pypi.org/安装,所以情况并非如此。

URLs specified in index-url variable were repository URLs not index URLs. index-url变量中指定的 URL 是存储库 URL,而不是索引 URL。 Per https://help.sonatype.com/display/NXRM3/PyPI+Repositories#PyPIRepositories-ConfiguringPyPIClientTools , index URLs seem to end in /simple .根据https://help.sonatype.com/display/NXRM3/PyPI+Repositories#PyPIRepositories-ConfiguringPyPIClientTools ,索引 URL 似乎以/simple结尾。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM