#!/usr/bin/env bash # Build the headquarters-api image. # # services/api/build.sh # # The tag is -[-dirty] from scripts/build-ref.sh, so a task # definition pins a build, not a moving tag. push.sh builds and pushes. set -euo pipefail REGISTRY="${REGISTRY:-179302349187.dkr.ecr.us-east-1.amazonaws.com/lance-blue}" IMAGE_NAME=headquarters-api # The API runs on Graviton (infra's arm64-by-default decision), so the image # is arm64 regardless of the machine building it. PLATFORM="${PLATFORM:-linux/arm64}" cd "$(dirname "$0")/../.." ref="${BUILD_REF:-$(scripts/build-ref.sh)}" image="$REGISTRY/$IMAGE_NAME:$ref" docker build --platform "$PLATFORM" --build-arg BUILD_REF="$ref" \ -f services/api/Dockerfile -t "$image" . echo echo "Built $image"