https://pantsbuild.org/ logo
#general
Title
# general
w

wonderful-iron-54019

08/31/2020, 6:17 PM
hypothetical: I've been refining a
docker_image
target suppose i wanted to include a pex binary as the entrypoint, how could i build the binary into the docker image, given the fact that both targeets are built in a hermetic environment, and i'd need to refer to the binary in my dockerfile
bonus points: include a v1 solution as well 😂 😭 😢
h

happy-kitchen-89482

08/31/2020, 6:54 PM
🧠
That is supposed to be a brain, not a fist...
I.e., I am thinking about it
w

wonderful-iron-54019

08/31/2020, 6:54 PM
lol
circling back to this. from my novice's understanding of the V2 engine it should be "simple" to do by expecting a Binary target and then putting in to the filesystem used to build the image. (would require a subclassed target or goal) V1 seems much trickier to me, the way we're resolving something liek that for publishing a wheel to artifactory is to take knowledge of where the wheel gets dumped, but it seems like it would be very difficult to write,
Actually that might work for getting the binary into the Docker context in V2 but referring to it in the Dockerfile is still an issue
h

happy-kitchen-89482

09/01/2020, 6:01 PM
v2 would definitely be the way to go. Your rule can
Get
the built binary and do whatever it wants with it. We'd need a way to write `Snapshot`s into a docker image.
w

wonderful-iron-54019

09/01/2020, 6:01 PM
right exactly
h

happy-kitchen-89482

09/01/2020, 6:03 PM
But we'll need that no matter what
w

wonderful-iron-54019

09/01/2020, 11:46 PM
fun fact: able to gett this working in v1 with a
builldroot_as_context
boolean that will essentially do a
docker build buildroot()
and then just using knowledge of where pants drops the artifact in the dockerfile. nor ideal
but it works