Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions .github/workflows/docker.build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,22 @@ jobs:
working-directory: ${{ runner.temp }}/digests
run: |
set -euo pipefail

# Docker Hub answers bursts of requests with 429 Too Many Requests,
# so every call to it is retried with a growing delay.
retry() {
local attempt=1 delay=30
until "$@"; do
if [ "${attempt}" -ge 5 ]; then
return 1
fi
echo "::warning::Attempt ${attempt} failed, retrying in ${delay} seconds"
sleep "${delay}"
attempt=$((attempt + 1))
delay=$((delay * 2))
done
}

versions="$(find . -mindepth 1 -maxdepth 1 -type d -name 'digest-*' | sed -n 's|^\./digest-\([0-9.]*\)-[a-z0-9]*$|\1|p' | sort -u)"
[ -n "${versions}" ] || { echo "::error::No digests found"; exit 1; }
for version in ${versions}; do
Expand All @@ -176,11 +192,14 @@ jobs:
sources+=("${image}@sha256:${digest}")
done
echo "::group::${image}:${version}"
docker buildx imagetools create \
retry docker buildx imagetools create \
--tag "${image}:${version%.*}" \
--tag "${image}:${version}" \
"${sources[@]}"
docker buildx imagetools inspect "${image}:${version}"
# Only Harbor is inspected, to spare Docker Hub the requests.
case "${image}" in
harbor.flownative.io/*) retry docker buildx imagetools inspect "${image}:${version}" ;;
esac
echo "::endgroup::"
done
done
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# The stage runs on the build platform and cross-compiles, so no emulation is
# involved.

FROM --platform=$BUILDPLATFORM golang:1-alpine AS envsubst-builder
FROM --platform=$BUILDPLATFORM harbor.flownative.io/docker.io/library/golang:1-alpine AS envsubst-builder

ARG ENVSUBST_VERSION=v1.4.2
ARG TARGETOS
Expand Down
Loading