ci,makefile: add hadolint Dockerfile linting
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
06da368535
commit
31220d9c1b
15
.drone.yml
15
.drone.yml
@ -8,6 +8,21 @@ platform:
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: hadolint
|
||||
pull: always
|
||||
image: hadolint/hadolint:v1.23.0-8-gb01c5a9-alpine
|
||||
commands:
|
||||
- hadolint --version
|
||||
- hadolint Dockerfile
|
||||
when:
|
||||
ref:
|
||||
- refs/heads/dev
|
||||
- "refs/heads/feature-**"
|
||||
- "refs/pull/**"
|
||||
- "refs/tags/**"
|
||||
event:
|
||||
exclude: [cron]
|
||||
|
||||
- name: kaniko-build
|
||||
pull: always
|
||||
image: immawanderer/drone-kaniko:linux-amd64
|
||||
|
||||
10
.hadolint.yaml
Normal file
10
.hadolint.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
ignored:
|
||||
# DL3039 error: Do not use dnf update.
|
||||
# image is nightly updated
|
||||
- DL3039
|
||||
# DL3041 warning: Specify version with `dnf install -y <package>-<version>`.
|
||||
- DL3041
|
||||
# SC2039 warning: In POSIX sh, brace expansion is undefined.
|
||||
# it actually still works
|
||||
- SC2039
|
||||
|
||||
9
Makefile
9
Makefile
@ -9,8 +9,13 @@ kanikoexecutorimg = gcr.io/kaniko-project/executor:debug
|
||||
kanikowdir = /src
|
||||
kanikocontext = .
|
||||
kanikoargs = -f=$(dfile) -c=$(kanikocontext) --use-new-run --snapshotMode=redo --no-push --force
|
||||
hadolintimg = hadolint/hadolint:v1.23.0-8-gb01c5a9-alpine
|
||||
hadolintargs = run --rm -i -v $$PWD/.hadolint.yaml:/root/.config/hadolint.yaml
|
||||
|
||||
.PHONY: build kaniko clean test prune
|
||||
.PHONY: hadolint build kaniko clean test prune
|
||||
|
||||
hadolint:
|
||||
$(dcmd) $(hadolintargs) $(hadolintimg) < $(dfile)
|
||||
|
||||
kaniko:
|
||||
$(dcmd) $(dargskaniko) $(kanikoexecutorimg) $(kanikoargs)
|
||||
@ -21,7 +26,7 @@ build:
|
||||
clean:
|
||||
$(dcmd) $(cleanargs)
|
||||
|
||||
test: build kaniko
|
||||
test: hadolint build kaniko
|
||||
|
||||
prune:
|
||||
$(dcmd) $(pruneargs)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user