Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Podman support by allowing defining the docker executable name #2920

Closed
komima opened this issue Jul 5, 2023 · 4 comments
Closed

Podman support by allowing defining the docker executable name #2920

komima opened this issue Jul 5, 2023 · 4 comments

Comments

@komima
Copy link

komima commented Jul 5, 2023

search you tried in the issue tracker

podman

describe your actual problem

I'd like to use podman (on Windows WSL2) as the docker-compatible backend, and use pre-commit docker/docker_image hooks against that.

Since the current implementation requires docker commands to be available those binaries need to be downloaded separately. There are also some very hard to debug inconsitensies in this setup (like docker run --rm ... run againsts the podman socket returns 0 instead of the actual code and causes hooks to pass, fixed lately containers/podman#18889).

Related issue (#2779) about pre-commit using the API instead of the executable was closed, so this would be an alternative way to use podman-based containers and not needing extra work to provide the docker cli for pre-commit.

Maybe this could be implemented via some kind of environment variable like PRE_COMMIT_DOCKER_EXECUTABLE=podman and populated to the commands from that, defaulting to docker?

pre-commit --version

pre-commit 3.3.0

@asottile
Copy link
Member

asottile commented Jul 5, 2023

please continue the discussion in #1243

@asottile asottile closed this as completed Jul 5, 2023
@asottile
Copy link
Member

asottile commented Jul 5, 2023

fwiw ln -s podman docker works pretty well for me

@ssbarnea
Copy link

Some users might have docker, some might have podman, some might have none. Forcing them to alter their system settings is intrusive and will likely break other tools/applications. Probably a more friendly mechanism would be to just look for first executable found and use that. I do expect that docker would still be prefered for back compatibility reasons. WDYT?

@asottile
Copy link
Member

#2920 (comment)

@pre-commit pre-commit locked as off-topic and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants