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

alert-dawn-51425

02/16/2023, 2:45 PM
Hey all, I am looking to run Pants within our CI system. We want to run Pants in a docker image. Is there any resources around how to build a docker file for this? I would like to avoid having to download pants each time the CI runs, and cache it in the docker file. I see that releases has the pexes (but I am looking for 2.15.0rc5 in particular).
h

happy-kitchen-89482

02/16/2023, 2:58 PM
If you run
./pants --version
as a step in the docker build it will bootstrap pants in the image
You'll have to rebuild the image when you upgrade Pants, but even then it should only need to re-build that last step
a

alert-dawn-51425

02/16/2023, 2:59 PM
Sweet, thanks I was running from the get-pants.sh script, but i will try this approach instead. Thank you
h

happy-kitchen-89482

02/16/2023, 3:02 PM
Sorry,
./pants
was force of habit
pants --version
works just as well
and is preferred
But either way, the point is to run something that forces Pants to boostrap itself (
--version
is the simplest)
a

alert-dawn-51425

02/16/2023, 3:03 PM
I wasn't getting it to install the pex for me for the particular version i was runing, so when i ran the CI tests, it would re-download
e

enough-analyst-54434

02/16/2023, 3:06 PM
Pants doesn't install a PEX. We release a PEX, but its use case tends to be niche.
Much more typically - Pants installs this: https://pypi.org/project/pantsbuild.pants
4 Views