Files
harmony/fleet/harmony-fleet-operator/build_docker.sh
Sylvain Tremblay b17ed1f6a0 feat(fleet): multi-stage Dockerfile + Harbor push script for operator
The operator Dockerfile previously copied a host-built binary into
archlinux:base — archlinux was a glibc-ABI workaround for that
host-build path. Convert to a two-stage build (rust:1.94-slim →
debian:bookworm-slim) so cargo runs inside the image. load-test.sh
loses its host cargo build + staging-context trick and now points
podman at the workspace root with -f. Add build_docker.sh as the
local Harbor entry point (DOCKER_TAG, PUSH overrides).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 13:48:21 -04:00

29 lines
820 B
Bash
Executable File

#!/usr/bin/env bash
# Build and push the harmony-fleet-operator image to Harbor.
#
# ./build_docker.sh # tag :dev
# DOCKER_TAG=v0.1.0 ./build_docker.sh
# PUSH=0 ./build_docker.sh # build only, skip push
#
# The Dockerfile is multi-stage and runs `cargo build` inside a pinned
# rust image, so the build context must be the workspace root (the
# operator depends on `path = "../../harmony"` crates).
set -euo pipefail
DOCKER_TAG="${DOCKER_TAG:-dev}"
PUSH="${PUSH:-1}"
IMAGE="hub.nationtech.io/harmony/harmony-fleet-operator:${DOCKER_TAG}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
docker build \
-f "$SCRIPT_DIR/Dockerfile" \
-t "$IMAGE" \
"$REPO_ROOT"
if [[ "$PUSH" == "1" ]]; then
docker push "$IMAGE"
fi