Is there any way to make `pants` aware of my alias...
# general
w
Is there any way to make
pants
aware of my aliases? E.g. I alias docker to podman, but pants doesn’t pick that up natively
l
Can you symlink
docker
to
podman
instead of using a shell alias?
w
That’s what I’ve done as a workaround
Feels gross
c
pants executes whatever
docker
means.. so I guess if you get the shell env to load a
.profile
or such with your alias in, it could work...? Not sure what you need to provide to make that happen though.
w
Hmm, need to investigate. So far,
podman
seems to work for my basic workflows (create some pexes and put them into a container to run FastAPI), so that’s awesome.
Next step is to get rid of the gross symlink, in favour of an alias - and we’re cruising
c
an alternative to alias (and symlink) is to use a ... man I lost the word.. (like, proxy script that you call
docker
and present it on the PATH to pants), which basically just calls
exec podman "$@"
w
Yeah, I know what you’re talking about. Just annoying that I’d have 2 workarounds, since I always have that alias on my machine (all my aliases are in a repo, linked between machines). I’ll look into this at some point, seems do-able that we could pull in user aliases or user info at some point in the build/sandbox
g
I'm dealing with a similar issue at work (we use a docker proxy script calling podman etc..). You can configure the docker section in pants.toml with stuff like 'executable_search_paths' and 'env_vars'. Might help you to resolve a proxy script and setting additional env vars. Also note that pants parses the ID of the built mage out of the docker build output. That part is not yet working in my setup
c
does podman present the image id in the output?
g
I thought it does but slightly different then docker. This way Pants does not "grep" it. Should be fixable
c
exactly, I was thinking if this should be configurable to cope with different tools, or simply hardcoded for the known ones as they come up..
w
Weird, I didn’t have any issues using this at runtime - once I put the shim in
a
w
❤️
This PR assumes the default podman machine is already running, correct? It doesn't bootstrap it
a
Yeah. It just looks for podman instead of docker. So functionally the same as symlinking
👍 1