diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 7f3f1a2..8fa4edd 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -1,6 +1,19 @@ +--- - id: docker-compose-check name: Validate docker-compose files - description: Checks that vault files are encrypted + description: Checks that docker-compose files are valid + language: script entry: compose-check.sh files: docker-compose.y[a]{0,1}ml$ - language: script +- id: hadolint + name: Lint Dockerfiles + description: Runs hadolint Docker image to lint Dockerfiles + language: docker_image + entry: hadolint/hadolint hadolint + files: Dockerfile +- id: hadolint-system + name: Lint Dockerfiles + description: Runs system hadolint to lint Dockerfiles + language: system + entry: hadolint + files: Dockerfile diff --git a/README.md b/README.md index 85ed4a8..f2abaa4 100644 --- a/README.md +++ b/README.md @@ -6,3 +6,9 @@ A set of [pre-commit](http://pre-commit.com) hooks for Docker services ### docker-compose-check Verifies that docker-compose files are valid by using `docker-compose config` to parse them. + +### hadolint +Uses the [hadolint Docker image](https://hub.docker.com/hadolint/hadolint) to lint Dockerfiles. + +### hadolint-system +Uses the whatever version of hadolint that you have installed to lint Dockerfiles. This requires you to have hadolint installed somewhere in your path. diff --git a/hooks.yaml b/hooks.yaml deleted file mode 100644 index 90504a8..0000000 --- a/hooks.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- id: docker-compose-check - name: Validate docker-compose files - description: Checks that docker-compose files are valid - entry: compose-check.sh - files: docker-compose.y[a]{0,1}ml$ - language: script