When building a `docker_image` target which includ...
# general
h
When building a
docker_image
target which includes a PEX via
pants package/run
is there a way to implicitly build that PEX for the platform of the Docker image? Or rather within that image itself? To remove the need for setting platforms/complete_platforms on the
pex_binary
target?
c
two methods comes to mind. a) using a
docker_environment
target or b) running pants from within a docker container. https://www.pantsbuild.org/docs/environments
h
> a) using a
docker_environment
target I am currently trying to integrate
docker_environment
targets into our build system but getting blocked on issues with Colima being our designated Docker runner. > b) running pants from within a docker container. I’ve seen threads discussing the PEX build step being done within the Docker image currently being targeted to run. For instance
pants run proj:docker-image
would build any PEX dependencies within that
docker-image
container since that’s the only required platform for that case. Is that something that’s being considered or anything close to it? It would be a nice way to avoid bulky PEXs that would currently be built if a lengthy
complete_platforms
list was provided for the PEX binary definition.
c
yea, I’ve not seen much beyond discussions for this, so don’t think there are anything concrete coming out of it around the corner in the near future, unfortunately.
h
Fair enough, that’s good to know at least. Am I right in thinking that cross-platform PEXs would be more restricted in their requirements in order to resolve? As in if I were to build a PEX for both macOS and manylinux21 would the dependencies have to have distributions that are mutually compatible?