nginx-proxy-manager/scripts/buildx
2023-07-24 14:41:46 +10:00

38 lines
988 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$DIR/.common.sh"
echo -e "${BLUE} ${CYAN}Building docker multiarch: ${YELLOW}${*}${RESET}"
cd "${DIR}/.." || exit 1
# determine commit if not already set
if [ "$BUILD_COMMIT" == "" ]; then
BUILD_COMMIT=$(git log -n 1 --format=%h)
fi
# Buildx Builder
docker buildx create --name "${BUILDX_NAME:-npm}" || echo
docker buildx use "${BUILDX_NAME:-npm}"
docker buildx build \
--build-arg BUILD_COMMIT="${BUILD_COMMIT:-notset}" \
--build-arg BUILD_DATE="$(date '+%Y-%m-%d %T %Z')" \
--build-arg BUILD_VERSION="${BUILD_VERSION:-dev}" \
--build-arg NOW="$(date --rfc-3339=s)" \
--build-arg SKIP_TESTS=1 \
--build-arg GOPRIVATE="${GOPRIVATE:-}" \
--build-arg GOPROXY="${GOPROXY:-}" \
--platform linux/amd64,linux/arm64,linux/arm/7 \
--progress plain \
--pull \
-f docker/Dockerfile \
$@ \
.
rc=$?
docker buildx rm "${BUILDX_NAME:-npm}"
echo -e "${BLUE} ${GREEN}Multiarch build Complete${RESET}"
exit $rc