Skip to content

Commit 56bfb8e

Browse files
committed
Add configuration for Dockerfile linting.
1 parent abdf399 commit 56bfb8e

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

.config/hadolint.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
# For all available rules see: https://github.com/hadolint/hadolint#rules
3+
ignored:
4+
- DL3008 # We do not want to pin versions in apt get install.
5+
- DL3018 # We do not want to pin versions in apk add
6+
7+
# For full details see https://github.com/hadolint/hadolint#configure
8+
#
9+
# The following keys are available:
10+
#
11+
# failure-threshold: string # name of threshold level (error | warning | info | style | ignore | none)
12+
# format: string # Output format (tty | json | checkstyle | codeclimate | gitlab_codeclimate | gnu | codacy)
13+
# label-schema: # See https://github.com/hadolint/hadolint#linting-labels for details
14+
# author: string # Your name
15+
# contact: string # email address
16+
# created: timestamp # rfc3339 datetime
17+
# version: string # semver
18+
# documentation: string # url
19+
# git-revision: string # hash
20+
# license: string # spdx
21+
# no-color: boolean # true | false
22+
# no-fail: boolean # true | false
23+
# override:
24+
# error: [string] # list of rules
25+
# warning: [string] # list of rules
26+
# info: [string] # list of rules
27+
# style: [string] # list of rules
28+
# strict-labels: boolean # true | false
29+
# disable-ignore-pragma: boolean # true | false
30+
# trustedRegistries: string | [string] # registry or list of registries

.github/workflows/dockerfile.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,28 @@ on:
77
pull_request:
88
branches: [ main ]
99
paths:
10+
- '.config/hadolint.yml'
11+
- '.dockerignore'
1012
- 'Dockerfile'
13+
# Docker project specific, Dockerfile "COPY" and "ADD" entries.
14+
- 'src/'
15+
- 'web/'
16+
- 'composer.json'
17+
- 'composer.lock'
18+
- 'site.conf'
1119
types: [ opened, reopened, synchronize ]
1220
# This event occurs when there is a push to the repository.
1321
push:
1422
paths:
23+
- '.config/hadolint.yml'
24+
- '.dockerignore'
1525
- 'Dockerfile'
26+
# Docker project specific, Dockerfile "COPY" and "ADD" entries.
27+
- 'src/'
28+
- 'web/'
29+
- 'composer.json'
30+
- 'composer.lock'
31+
- 'site.conf'
1632
# Allow manually triggering the workflow.
1733
workflow_dispatch:
1834

@@ -35,3 +51,4 @@ jobs:
3551
with:
3652
args: >-
3753
hadolint
54+
--config .config/hadolint.yml

0 commit comments

Comments
 (0)