Is there a way to have Pants only lint Docker imag...
# general
b
Is there a way to have Pants only lint Docker images, but not build? That is, if I run
./pants package ::
, is there a way to not have it try to build the images?
f
to run hadolint?
if that, then
./pants lint ::
b
Right... that part is fine, I just don't want Pants to ever try to build these images.
f
if there is some other checks/linting being done during the image build, then that probably would have to be pulled out into a rule that could run under the lint or check goals
there’s a
skip_push
field
you probably want something like
skip_package
or
no_default_package
which would need to be implemented, but is a straight-easy contribution to make for a suitably motivated contributor
(although you can add a tag and then exclude targets with that tag)
My thought is maybe targets could be marked such that they did not match patterns like
::
but required specifying their exact address to process them.
so
./pants package path/to/target:some_docker_image
would build it but
./pants package ::
would skip it
b
Gotcha, thanks 👍
f
to be clear, I don’t plan on implementing it. feel free to open an issue with this idea if you’d like to see it.
h
Interesting use case. In python we model this by having the lintable thing be
python_sources
, and then a separate packageable target such as
pex_binary
or
python_distribution
points to the python_sources it consumes.
But that's not how we modeled the targets for Docker
We should probably be more uniform about this sort of thing