Skip to content

Commit fc52779

Browse files
committed
Fix build issues on modern docker + GIT_VERSION
1 parent 10ceb32 commit fc52779

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

skaffold-builder.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
set -e
3+
4+
cd $(dirname $0)
5+
6+
# https://github.com/moby/moby/issues/42845
7+
export DOCKER_BUILDKIT=0
8+
9+
export GIT_VERSION="$(git describe --tags --abbrev=0)@$(git rev-parse HEAD)"
10+
docker build --pull --progress=tty --build-arg "GIT_VERSION=$GIT_VERSION" -t "$IMAGE" "$BUILD_CONTEXT"
11+
12+
if $PUSH_IMAGE; then
13+
docker push $IMAGE
14+
fi

skaffold.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ build:
44
artifacts:
55
- image: fluentdemo
66
context: .
7-
docker:
8-
buildArgs:
9-
GIT_VERSION: '{{if .IMAGE_TAG}}{{.IMAGE_TAG}}{{else}}0.0.0dev0{{end}}'
7+
custom:
8+
buildCommand: sh skaffold-builder.sh
9+
#docker:
10+
# buildArgs:
11+
# GIT_VERSION: '{{if .IMAGE_TAG}}{{.IMAGE_TAG}}{{else}}0.0.0dev0{{end}}'
1012
tagPolicy:
1113
gitCommit:
1214
ignoreChanges: true # no -dirty flag

0 commit comments

Comments
 (0)