Skip to content
Snippets Groups Projects
Commit 3fe24570 authored by nimrod's avatar nimrod
Browse files

Use the Dockerfile from this repo to lint the Dockerfile.

Instead of using the latest image of docker-pre-commit in Docker Hub,
build the image locally and use that to lint the Dockerfile. Added a
wrapper script for that.
parent a68f1900
No related branches found
No related tags found
No related merge requests found
...@@ -29,14 +29,15 @@ repos: ...@@ -29,14 +29,15 @@ repos:
- id: hadolint - id: hadolint
name: Hadolint Dockerfile linter name: Hadolint Dockerfile linter
description: Dockerfile linter, validate inline bash, written in Haskell description: Dockerfile linter, validate inline bash, written in Haskell
minimum_pre_commit_version: '0.18.0'
language: docker_image
entry: adarnimrod/docker-pre-commit hadolint
types: [dockerfile] types: [dockerfile]
language: script
entry: pre-commit-docker-wrapper
args: [hadolint]
- id: dockerfile-lint - id: dockerfile-lint
name: dockerfile-lint name: dockerfile-lint
description: A rule based 'linter' for Dockerfiles description: A rule based 'linter' for Dockerfiles
minimum_pre_commit_version: '0.18.0' minimum_pre_commit_version: '0.18.0'
language: docker_image
entry: adarnimrod/docker-pre-commit dockerfile-lint
types: [dockerfile] types: [dockerfile]
language: script
entry: pre-commit-docker-wrapper
args: [hadolint]
#!/bin/sh
set -eux
docker build -t docker-pre-commit .
docker run -v "$PWD:/repo:ro" -w /repo --user "$(id -u):$(id -g)" --rm docker-pre-commit "$@"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment