Hey folks, does anyone have tips on how to get doc...
# general
m
Hey folks, does anyone have tips on how to get docker working cross-platform? I need this configured in my
pants.toml
to get things building on macOS (as docker needs that integration), but of course, in ubuntu-based CI, this tool doesn’t exist!
Copy code
[docker]
tools = ["docker-credential-osxkeychain"]
✅ 1
Is adding an empty
tools = []
in
pants.ci.toml
the only approach? I know I’ll need to get pants working on a windows machine soon, so this is will become important for non-CI environments soon too.
f
You can also use optional_tools for this, instead of separate configs https://www.pantsbuild.org/stable/reference/subsystems/docker#optional_tools
🤦‍♂️ 1
e
• You can use
~/.pants.rc
to set anything that should be set in
pants.toml
but only needs to apply on certain machines. ◦ This does mean configuring it on each machine. At $DAYJOB I created developer install scripts for each system (wsl/ubuntu/macOS) that install a bunch of dependencies, including writing particular OS-specific
~/.pants.rc
files • Another idea would be to have something like
pants.toml
,
pants.mac.toml
,
pants.windows.toml
, etc. and then use an env var to set https://www.pantsbuild.org/stable/reference/global-options#pants_config_files to eg.
"['pants.toml', 'pants.mac.toml']"
. Then you could configure this env var in
~/.bashrc
or whatever similar file exists in any particular os. This still requires a per-machine setup, but might simplify that setup (and keep the knowledge of what different settings are required for each OS committed to the repo)
m
Thanks @fresh-mechanic-68429 & @elegant-florist-94385! Both are useful here — optional tools & platform-specific toml files to help other engineers be ready & set up for common situations, and
~/.pantsrc
for stuff that’s specific to my machine 😊
e
platform-specific toml files
Just to be clear, this is not something "supported" by pants. Pants just supports configuration that allows multiple toml files to be passed. I've just found it convenient to leverage this for OS-specific configs. You still need to configure each individual machine to use the right set of config files.
👍 1