Skip to content

[feature request]: docker support #11

Open

Description

@henryiii

I tried out the pre-commit ci on CLI11 and immediately ran into the fact that docker is not available. Would it be possible to eventually support the docker pre-commit actions? I use clang-format quite often.

Activity

  1. added
    enhancement
    on Oct 28, 2020
  2. asottile commented on Oct 28, 2020

    @asottile
    Member

    I'm not sure how docker support fits into the puzzle unfortunately. it will probably have to be a pro feature, if at all due to needing network at runtime (a risk I'm not currently willing to take)

  3. asottile commented on Oct 28, 2020

    @asottile
    Member

    I could maybe do some podman-in-podman shenanigans 🤔

  4. mathbunnyru commented on May 29, 2021

    @mathbunnyru

    It would be nice to have a support for docker in pre-commit.ci, some checks are based on docker.

    Maybe, more general feature would be to support building in the custom docker image, though.

  5. asottile commented on May 31, 2021

    @asottile
    Member

    @mathbunnyru that's already implement, though disabled at the moment. it's unfortunately costly to enable the feature and introduces a lot of unpredictability in the runtime -- it will likely be locked behind hosted / pro-tier due to those reasons

    that said, there will be add-ons at some point which will make "customizing" the image easier (for example, a "terraform" add-on might put a system terraform binary on the PATH) (#13)

  6. mathbunnyru commented on May 31, 2021

    @mathbunnyru

    @mathbunnyru that's already implement, though disabled at the moment. it's unfortunately costly to enable the feature and introduces a lot of unpredictability in the runtime -- it will likely be locked behind hosted / pro-tier due to those reasons

    that said, there will be add-ons at some point which will make "customizing" the image easier (for example, a "terraform" add-on might put a system terraform binary on the PATH) (#13)

    Thanks, @asottile.

  7. Kurt-von-Laven commented on Oct 1, 2021

    @Kurt-von-Laven

    I'm not sure how docker support fits into the puzzle unfortunately. it will probably have to be a pro feature, if at all due to needing network at runtime (a risk I'm not currently willing to take)

    @asottile, would only supporting rootless Docker with networking disabled be a viable option? Personally, I'm not a huge fan of pre-commit hooks that require runtime network access (beyond setting up the environment of course) in the first place since they can make working offline a hassle.

  8. henryiii commented on Oct 1, 2021

    @henryiii
    Author

    For completeness, a few days ago clang-format was released as wheels for all platforms, and that solved my issues; it's now easy to run clang-format instantly anywhere and it's a 1 MB to max 2MB download. That runs conda-forge (~200MB after days of fighting with it, down from 650 MB) in the the ground, and Docker obviously is behind even that. And you can pin 10, 11, or 12.

    repos:
    - repo: https://github.com/ssciwr/clang-format-hook
      rev: v12.0.1
      hooks:
      - id: clang-format

    This is only a solution for this one specific case, but it's a good one! I've moved all five of my previously docker-using repos to pre-commit.ci now. Pretty sure I wasn't using docker anywhere else for anything else in pre-commit.

  9. asottile commented on Oct 1, 2021

    @asottile
    Member

    if this gets implemented it'll be rootless networkless podman -- but it's fairly far off, complicated, and low on the priority list at the moment

  10. asottile commented on Nov 15, 2022

    @asottile
    Member

    I've just released a brand new "lite" version of pre-commit.ci which may be of interest until the full version has language: docker support. you can read more about it at https://pre-commit.ci/lite -- the tl;dr is adds autofixing to GitHub Actions

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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions