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 @@ -163,6 +163,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 @@ -180,11 +196,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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# The stage runs on the build platform and cross-compiles, so no emulation is
# involved.

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

ARG PHP_FPM_EXPORTER_VERSION=0ef3d973d5046059993d90dc32c86f36eab0929f
ARG TARGETOS
Expand All @@ -27,7 +27,7 @@
# -----------------------------------------------------------------------------
# The actual image

FROM ${PHP_BASE_IMAGE}

Check warning on line 30 in Dockerfile

View workflow job for this annotation

GitHub Actions / test (8.5)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ${PHP_BASE_IMAGE} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 30 in Dockerfile

View workflow job for this annotation

GitHub Actions / test (8.4)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ${PHP_BASE_IMAGE} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 30 in Dockerfile

View workflow job for this annotation

GitHub Actions / test (8.3)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ${PHP_BASE_IMAGE} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 30 in Dockerfile

View workflow job for this annotation

GitHub Actions / test (8.2)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ${PHP_BASE_IMAGE} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 30 in Dockerfile

View workflow job for this annotation

GitHub Actions / test (8.3)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ${PHP_BASE_IMAGE} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 30 in Dockerfile

View workflow job for this annotation

GitHub Actions / test (8.2)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ${PHP_BASE_IMAGE} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 30 in Dockerfile

View workflow job for this annotation

GitHub Actions / test (8.5)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ${PHP_BASE_IMAGE} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 30 in Dockerfile

View workflow job for this annotation

GitHub Actions / test (8.4)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ${PHP_BASE_IMAGE} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

ENV BANNER_IMAGE_NAME="Beach PHP" \
BEACH_APPLICATION_PATH="/application" \
Expand All @@ -41,7 +41,7 @@

COPY root-files /

COPY --from=blackfire/blackfire:2 /usr/local/bin/blackfire /opt/flownative/php/bin/
COPY --from=harbor.flownative.io/docker.io/blackfire/blackfire:2 /usr/local/bin/blackfire /opt/flownative/php/bin/

COPY --from=php-fpm-exporter-builder /out/php-fpm_exporter /opt/flownative/php/bin/php-fpm-exporter

Expand Down
Loading