I’m working through migrating our current python virtual environments over to execution environments. I haven’t been able to figure out how to pull python modules or container images from our private repository/registry, which needs a username/password to auth to. I have a requirement where all python modules and container images need to be pulled from our repository/registry. I didn’t see anything in the Execution Environment Setup Reference documentation for this.
Any help or direction on where to look for a solution would be appreciated
How ansible-builder builds artefacts is relatively straightforward - ansible-builder create generates a context directory containing a dockerfile and requirements files etc
Using a private container registry should therefore be as easy as running docker login before running ansible-builder build
I’m not sure about how private python registries are accessed - you might need to inject an auth file into the context
I have the same requirement and moreover I don’t want the pip.conf to persist in the container. I only want it to be present during the build stage.
The best method for that would be to use docker build secrets but to use them I need to pass the secret to the docker build command which is easy using the --extra-build-cli-args='--secret id=pip_conf,src=/etc/pip.conf
However, that’s only one part of the equation because I also need to MOUNT the secret when the pip_install script runs which I don’t believe is possible using the YAML definition.
The only solution I can think of right now is to ansible-builder create modify the dockerfile and call docker build which is not super elegant unfortunately