This question is in line with the previous one as ...
# general
c
This question is in line with the previous one as I am also exploring potential solutions. Currently our team often pulls docker images for testing purposes but building is done within our CI/CD pipeline. Is there a way I can prevent developers to build a docker image with
pants package ::
when they not on a specific platform, but allow building of pex files? I assume I would have to write a plugin for that, just curious how I should approach this
h
This is a good question. So you do want to allow building local pex files, just not allow them to be embedded in a docker image?
@curved-television-6568 It may make sense to have this as a feature of docker support - some sort of check that the platform of the binary matches the platform of the docker image
c
such a check would be great as it would avoid confusion on why the docker images, which are build locally, are not running. A warning would be great already
c
h
It is exactly that, IIUC! @cuddly-teacher-45066 your comments/vote on that issue would help prioritize it
c
thanks everyone let me do this
c
The OP seems to be about not building the images in the first place, so that precedes the goal of #13185. Would it make sense to have an option to first attempt to pull the image being built, and only build it if the pull failed. That way, if the images are already built and pushed by CI/CD, then the developers get to use those images transparently.. Perhaps something like this:
Copy code
./pants package --docker-prefetch-images ::
Where the
--docker-prefetch-images
is the feature toggle asking to first pull the image being built, and if it exists, avoid rebuilding it. That option could be set by default in your
pants.toml
and disabled in a
pants.ci.toml
to always build within the CI/CD pipeline.
h
Ah good point
That is different
c
I like this idea a lot! @curved-television-6568
👍 1