Skip to content

Podman support by allowing defining the docker executable name #2920

Closed

Description

@komima

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 podman-container-tools/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

Activity

  1. asottile commented on Jul 5, 2023

    @asottile
    Member

    please continue the discussion in #1243

  2. asottile commented on Jul 5, 2023

    @asottile
    Member

    fwiw ln -s podman docker works pretty well for me

  3. ssbarnea commented on Jun 17, 2024

    @ssbarnea

    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?

  4. asottile commented on Jun 17, 2024

    @asottile
    Member
  5. locked as off topic and limited conversation to collaborators on Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions