hypothetical: I've been refining a `docker_image` ...
# general
w
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
🧠
That is supposed to be a brain, not a fist...
I.e., I am thinking about it
w
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
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
right exactly
h
But we'll need that no matter what
w
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