Currently a language: docker hook only supports running a Docker image which it built itself (via a Dockerfile).
However this seems a little unnecessary and expensive since we can and should be building and publishing our Docker images to a registry.
Would there be interest in supporting using existing images as hooks? It should be simple and I'd be happy to make the PR.
Proposed .pre-commit-hooks.yaml change
- id: flake8-docker
name: flake8 (via docker)
description: flake8, but provided by docker
files: \.py$
language: docker
# Image to `docker pull`
docker_image: my.registry.example.com/pre-commit-hooks/flake8:latest
# Optional: use `ENTRYPOINT` of the image if not specified
entry: flake8
Currently a
language: dockerhook only supports running a Docker image which it built itself (via aDockerfile).However this seems a little unnecessary and expensive since we can and should be building and publishing our Docker images to a registry.
Would there be interest in supporting using existing images as hooks? It should be simple and I'd be happy to make the PR.
Proposed
.pre-commit-hooks.yamlchange