I am using AAP execution environment feather and trying to build a customized image for that. I have python packages need to be installed to the custom image. I have them listed in requierments.txt file. I believe ansible-builder uses pip3 to install them. But how can I pass some options? For example, I want to install XYZ python package. I can run:
pip3 install --user XYZ==2.1.0.0
In execution-environment.yml, how can I achieve this? If I do
additional_build_steps:
prepend_base: RUN pip3 install --user XYZ
What is the impact to XYZ I listed in requirements.txt?
If you already have a requirements.txt file then you can pass that directly into your execution-environment.yml by using the dependencies option. I’ve always kept it in the same root folder as the execution-environment.yml so not sure if it supports paths. Example below:
I have broken out to a shell/container commands under the addtional_build_steps when I needed to do something like a non-standard package location or the like but that’s not the norm in my experience. The method above has worked well for our builds.
If you’re getting a build error, feel free to post that back and I’ll be happy to take a look.
*note: updated base_image to include a real image to avoid confusion.
Apologies for the double post, just re-read your original question (will do a better job at that in the future). For other options like “–user”, I’ve had to put them in the additional_build_steps similar to what you have listed. I usually execute them in the append_final step as we’ve moved to version 3 for most of our configs. Depending on where in the build process you may need to use a different option. The link in my first post has some good references. In this example we were having issues getting pywinrm[kerberos] to install via the requirements.txt and moved to doing it after the main build steps were finished.