This question is in line with the previous one as ...
# general
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
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
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
It is exactly that, IIUC! @cuddly-teacher-45066 your comments/vote on that issue would help prioritize it
thanks everyone let me do this
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
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
and disabled in a
to always build within the CI/CD pipeline.
Ah good point
That is different
I like this idea a lot! @curved-television-6568
👍 1