fix(kaniko): supply build args {in ci,locally}
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
since the switch to kaniko as a container image builder, proper BUILD_DATE and VCS_REF values previously filled in by a build hook were left empty. that changes now.
This commit is contained in:
parent
01c9a0fbc4
commit
6f62b808d7
@ -29,6 +29,9 @@ steps:
|
||||
settings:
|
||||
dockerfile: Dockerfile
|
||||
context: .
|
||||
args:
|
||||
- BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
|
||||
- VCS_REF=${DRONE_COMMIT_SHA:0:7}
|
||||
when:
|
||||
ref:
|
||||
- "refs/heads/feature-**"
|
||||
@ -43,6 +46,9 @@ steps:
|
||||
settings:
|
||||
dockerfile: Dockerfile
|
||||
context: .
|
||||
args:
|
||||
- BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
|
||||
- VCS_REF=${DRONE_COMMIT_SHA:0:7}
|
||||
tags:
|
||||
- latest
|
||||
- linux-amd64
|
||||
|
4
Makefile
4
Makefile
@ -8,7 +8,9 @@ dargskaniko = run --rm -it -w=$(kanikowdir) -v $$PWD:$(kanikowdir)
|
||||
kanikoexecutorimg = gcr.io/kaniko-project/executor@sha256:6ecc43ae139ad8cfa11604b592aaedddcabff8cef469eda303f1fb5afe5e3034
|
||||
kanikowdir = /src
|
||||
kanikocontext = .
|
||||
kanikoargs = -f=$(dfile) -c=$(kanikocontext) --use-new-run --snapshotMode=redo --no-push
|
||||
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")
|
||||
hadolintimg = hadolint/hadolint:v2.7.0-alpine
|
||||
hadolintargs = run --rm -i -v $$PWD/.hadolint.yaml:/root/.config/hadolint.yaml
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user