<#21098 method to have optional docker.tools> Issu...
# github-notifications
c
#21098 method to have optional docker.tools Issue created by cburroughs Is your feature request related to a problem? Please describe. We use amazon-ecr-credential-helper to authenticate to ECR (Amazon's Docker registry offering) where we store Docker images. We configure it for Pants as:
Copy code
[docker]
tools = ["docker-credential-ecr-login"]
However,
docker-credential-ecr-login
shells out to additional operating system dependent binaries: • MacOS `sw_vers` • Linux `getent` We currently handle this with instruction to setup a short
~/.pants.rc
file like:
Copy code
$ cat ~/.pants.rc
    [docker]
    tools.add = ["sw_vers"]
But this this manual out-of-repo step is a source of papercuts.
docker.tools
requires the binaries to exist to we can't list the super set of all needed ones:
Copy code
13:22:52.49 [ERROR] 1 Exception encountered:

Engine traceback:
  in `publish` goal

BinaryNotFoundError: Cannot find `sw_vers` on `['/bin', '/home/ecsb/.cargo/bin', '/home/ecsb/.local/bin', '/home/ecsb/bin/', '/opt/bin', '/sbin', '/usr/bin', '/usr/lib/llvm/14/bin', '/usr/lib/llvm/15/bin', '/usr/lib/llvm/16/bin', '/usr/lib64/julia-1.9.4/bin', '/usr/local/bin', '/usr/local/sbin', '/usr/sbin']`. Please ensure that it is installed so that Pants can use docker.
Describe the solution you'd like
docker.optional_tools
or another way of listing tools that should be used if present, but do not throw an error when absent. Describe alternatives you've considered Some sort of way to specify per OS
docker.tools
I think this would eventually turn into a mini-langauge for (OS,arch,libc) and be quite complex. Additional context I thought this had been discussed in a prior issue, but I have failed to find it. pantsbuild/pants