ambitious-student-81104
03/15/2022, 4:55 PMthe idea is that there would a build-time container, and the pex would be built in that, and then copied into the deployment image, which is what theIs this build-time container gonna have all the source code needed and be re-used to build whatever we need to deploy?target describesdocker_image
hundreds-father-404
03/15/2022, 4:56 PMCurrently how we do this is we copy the source code into our Dockerfile, and our CD system builds the Dockerfile, and deploys the PEX built inside.How are you building the PEX currently? E.g. are you running Pants inside the Docker image
ambitious-student-81104
03/15/2022, 10:59 PMhundreds-father-404
03/15/2022, 11:00 PMpex_binary
for you beforehand, using the normal Pants cache etc. Then it will copy the file into the Docker image for you.
Are you already using the platforms
field with the pex_binary
target?happy-kitchen-89482
03/15/2022, 11:00 PMhappy-kitchen-89482
03/15/2022, 11:01 PMhappy-kitchen-89482
03/15/2022, 11:02 PMcurved-television-6568
03/16/2022, 7:22 AMcurved-television-6568
03/16/2022, 7:25 AMhappy-kitchen-89482
03/16/2022, 3:21 PMdocker_image
target that depends on a pex_binary
target should work today: When you build the docker_image
target Pants will first build the pex natively (which is fine, since that is still linux), and then embed it in the Docker image.ambitious-student-81104
03/16/2022, 4:17 PMyou can volume mount relevant cache directories into your build-time container in order to gain some efficiency back.not sure how this will work. ci box starts afresh for each run, no? are you suggesting external storage?
curved-television-6568
03/16/2022, 6:34 PM> you can volume mount relevant cache directories into your build-time container in order to gain some efficiency back.
not sure how this will work. ci box starts afresh for each run, no? are you suggesting external storage?ah, right. yes in that case thereโd need to be some remote syncing of caches during startup https://www.pantsbuild.org/docs/using-pants-in-ci#directories-to-cache