Skip to content

Commit c811a8c

Browse files
committed
Fix build issues on modern docker + GIT_VERSION
1 parent 2c2ce15 commit c811a8c

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ build:
44
artifacts:
55
- image: djangofluent
66
context: .
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}}'
712
tagPolicy:
813
gitCommit:
914
ignoreChanges: true # no -dirty flag

0 commit comments

Comments
 (0)