diff --git a/build/Dockerfile b/build/Dockerfile index c43e074c..2ce7981c 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -24,7 +24,7 @@ COPY / /src RUN mkdir -p /var/run/vars && \ cd /src && \ - git describe --abbrev=0 --tags > /var/run/vars/GIT_LAST_TAG && \ + git describe --abbrev=0 --tags > /var/run/vars/GIT_LAST_TAG || echo "dev" > /var/run/vars/GIT_LAST_TAG && \ CGO_ENABLED=0 go build \ -ldflags "-X github.com/haproxytech/kubernetes-ingress/pkg/version.GitTag=$(cat /var/run/vars/GIT_LAST_TAG)" \ -o fs/haproxy-ingress-controller . diff --git a/build/Dockerfile.pebble b/build/Dockerfile.pebble index 00a6cd3c..f0349462 100644 --- a/build/Dockerfile.pebble +++ b/build/Dockerfile.pebble @@ -26,7 +26,7 @@ RUN go install github.com/canonical/pebble/cmd/pebble@v1.2.0 RUN mkdir -p /var/run/vars && \ cd /src && \ - git describe --abbrev=0 --tags > /var/run/vars/GIT_LAST_TAG && \ + git describe --abbrev=0 --tags > /var/run/vars/GIT_LAST_TAG || echo "dev" > /var/run/vars/GIT_LAST_TAG && \ CGO_ENABLED=0 go build \ -ldflags "-X github.com/haproxytech/kubernetes-ingress/pkg/version.GitTag=$(cat /var/run/vars/GIT_LAST_TAG)" \ -o fs/haproxy-ingress-controller .