ripe-gigabyte-88964
03/23/2023, 8:15 PMpex_binary
target to the extra_build_args
field of a docker_image
target?broad-processor-92400
03/23/2023, 8:22 PMextra_build_args
?
To answer your question, unless you customise output_directory
, we have a macro that does something like:
target = pex_binary(name="...", ...)
output_directory = ".".join(build_file_dir().parts)
pex_path = f"{output_diretory}/{target.name}.pex"
and I imagine pex_path
could be fed into extra_build_args
.ripe-gigabyte-88964
03/23/2023, 8:25 PMbroad-processor-92400
03/23/2023, 9:47 PMdocker_image
with inline `instructions`: https://pantsbuild.slack.com/archives/C046T6T9U/p1668559231617069?thread_ts=1668559186.539269&cid=C046T6T9U
That is, rather than have a fixed Dockerfile
and pass args in, we just format the instructions appropriately.
If that's not appropriate, I'm guessing adapting the docker_image
to have something like extra_build_args=[f"PACKAGED_PEX={pex_path}"], dependencies=[":{target.name}"]
would work (I think you'll need the explicit dependency on the PEX in that case, because I assume pants won't infer from extra_build_args
, but it will infer if the appropriate string appears in the instructions)