At work, we needed a Docker image to use as our Ray head node. It needs to contain Python modules that are stored in our private PyPI repository. To build the Docker image and install the Python dependencies, I have first tried to use basic authentication in the index URL passed to pip as follows: RUN pip install –index-url https://username:password@nexus.example.com some-python-module==0.25.0 This works. And since this Dockerfile is stored in a private version control repository, you might think that’s OK.