ansible-builder icon indicating copy to clipboard operation
ansible-builder copied to clipboard

Add support for build-requirements.txt

Open pabelanger opened this issue 4 years ago • 3 comments

There is a need downstream, to include python build dependencies into the python-builder image, but not the final image. For this case, we've added support for build-requirements.txt file. But need to now allow for that in Dockerfiles generated by ansible-builder.

https://github.com/ansible/python-builder-image/pull/35

pabelanger avatar Apr 26 '21 15:04 pabelanger

In this example, setuptools_scm is needed to compile a wheel, however isn't needed by the wheel installed into the final image.

pabelanger avatar Apr 26 '21 15:04 pabelanger

What's the interface here? A file needs to be created, /tmp/src/build-requirements.txt.

Where does that go in the process? It looks like it would be:

  • User maintains another python requirements file for build requirements, separate from the existing file we support
  • That gets referenced somewhere in the definition file
  • Given those things, an ADD layer is added in the builder stage before the assemble script, and nothing else is needed

AlanCoding avatar May 26 '21 14:05 AlanCoding

I think these is also required for bindeps. For example, I might need gcc + Python header files in the builder image to build a wheel, but I don't want them in the final image.

mkjpryor avatar Jun 26 '23 11:06 mkjpryor