2022-01-19 17:29:03 +01:00
|
|
|
dcmd = docker
|
|
|
|
dfile = Dockerfile
|
|
|
|
dtag = immawanderer/fedora-distcc:testbuild
|
|
|
|
dargs = build -t $(dtag) --no-cache --pull - < $(dfile)
|
|
|
|
cleanargs = image rm -f $(dtag)
|
|
|
|
pruneargs = system prune -af
|
|
|
|
dargskaniko = run --rm -it -w=$(kanikowdir) -v $$PWD:$(kanikowdir)
|
2022-03-23 16:36:41 +01:00
|
|
|
kanikoexecutorimg = gcr.io/kaniko-project/executor:v1.8.0-debug
|
2022-01-19 17:29:03 +01:00
|
|
|
kanikowdir = /src
|
|
|
|
kanikocontext = .
|
|
|
|
kanikoargs = -f=$(dfile) -c=$(kanikocontext) --use-new-run --snapshotMode=redo --build-arg BUILD_DATE=$(build_date) --build-arg VCS_REF=$(vcs_ref) --no-push
|
|
|
|
vcs_ref = $$(git rev-parse --short HEAD)
|
|
|
|
build_date= $$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
2022-03-26 03:21:10 +01:00
|
|
|
hadolintimg = hadolint/hadolint:v2.9.3-alpine
|
2022-01-19 17:29:03 +01:00
|
|
|
hadolintargs = run --rm -i -v $$PWD/.hadolint.yaml:/root/.config/hadolint.yaml
|
|
|
|
|
|
|
|
.PHONY: hadolint build kaniko clean test prune
|
|
|
|
|
|
|
|
hadolint:
|
|
|
|
$(dcmd) $(hadolintargs) $(hadolintimg) < $(dfile)
|
|
|
|
|
|
|
|
kaniko:
|
|
|
|
$(dcmd) $(dargskaniko) $(kanikoexecutorimg) $(kanikoargs)
|
|
|
|
|
|
|
|
build:
|
|
|
|
$(dcmd) $(dargs)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(dcmd) $(cleanargs)
|
|
|
|
|
|
|
|
test: hadolint build kaniko
|
|
|
|
|
|
|
|
prune:
|
|
|
|
$(dcmd) $(pruneargs)
|