Should there be a way to specify "optional" docker...
# general
c
Should there be a way to specify "optional" docker tools? <https://www.pantsbuild.org/docs/reference-docker#tools>
docker-credential-ecr-login
now appears to shell out to <https://ss64.com/osx/sw_vers.html> which obviously exists on Mac but not Linux. It would be nice of ~half of developers didn't need an rc file just for this.
c
perhaps it would make more sense to be able to set
tools
based on environment, in the same manner as is done for https://www.pantsbuild.org/docs/reference-docker#env_vars where you can have different env vars depending on the host platform (such as Mac vs Linux).
you could then have two local environments, with different tools based on the host platform.
c
That would require using Environments though, right?
c
yes, but if you only rely on
local_environment
targets, I think it would mostly boil down to become a configuration layer (i.e. no remote execution stuff)
my main concern with marking optional tools is that they’re not always optional.. otoh there may be other scenario where they are proper optional, so the feature may be warranted any way..
c
hmm. Buf if you were "really" using environments by way of docker, wouldn't you still need a way to configure the tools for the docker daemon? ("Need" might be too strong a word, but it is a papercut ~half of engineers will immediately trip on.)
c
yes, so I think making
tools
an environment aware option is a thing we want to do.
c
I have not done more than a proof of concept with environments, so I might just be being dense here. But to use a
docker_environment
, don't you need a
docker
backend configured? (in which case you would be back to the same problem?) Or do you first define a
docker_environment
that is responsible for talking to the
docker_environment
?
c
ah, the pants
docker
backend for building/running/pushing images are different from the setup required to use docker as a pants execution environment.
for the latter, it’s implemented in the rust engine using the bollard crate, while the backend is in Python relying on shelling out using the
docker
cli client only.