79810181

Date: 2025-11-05 14:19:11
Score: 1
Natty:
Report link

Thanks to #DavidMaze comment 🙏 ...

You can set an environment variable PIP_EXTRA_INDEX_URL with the same effect, and either pass it in via a Dockerfile ARG (be careful to use a multistage build to avoid leaking the token though) or a build secret. See for example Passing PIP_EXTRA_INDEX_URL to docker build.

... to pass the argument, I added in .gitlab-ci.yml, in dockerize-env \ script :

export PIP_EXTRA_INDEX_URL="https://gitlab-ci-token:[email protected]/api/v4/groups/<GROUP_ID>/-/packages/pypi/simple"

and in DockerFile.project_env:

# Add a variable accessible during image build
# so that pip can access internal pypi repo
ARG PIP_EXTRA_INDEX_URL

After that my_package_on_gitlab_private_pypi can be installed from internal Pypi 🎉

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Blacklisted phrase (0.5): 🙏
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: PiWi