#!/usr/bin/env bash # Build the three caption-ninja images from a pinned captions-deploy commit. # # captions-deploy (git.coopcloud.tech/captions.coop/captions-deploy) pins the # captions.coop forks of captionninja and caption-local as submodules and owns # the UI image (web/Dockerfile). Nobody publishes images, so we build them here. # Run this on a Docker host; it needs no registry credentials. Images are tagged # with their final registry names so a single-node swarm can deploy them directly. # See README.md "Images" for pushing them to the registry afterwards. # # usage: images/build.sh [workdir] set -euo pipefail REGISTRY=git.autonomic.zone/recipe-maintainers DEPLOY_REPO=https://git.coopcloud.tech/captions.coop/captions-deploy.git DEPLOY_COMMIT=12fe0fade41ca65e1dda3704eb4fd9e204fde698 VERSION=2026.10.13 # date of DEPLOY_COMMIT; images share one semver-like tag work="${1:-$(mktemp -d)}/captions-deploy" tag="$VERSION-${DEPLOY_COMMIT:0:7}" rm -rf "$work" git init -q "$work" git -C "$work" fetch -q --depth 1 "$DEPLOY_REPO" "$DEPLOY_COMMIT" git -C "$work" checkout -q FETCH_HEAD # Submodule URLs are SSH; fetch them anonymously over HTTPS instead. git -C "$work" -c url."https://git.coopcloud.tech/".insteadOf="ssh://git@git.coopcloud.tech:2222/" \ submodule update -q --init --depth 1 git -C "$work" submodule status docker build -t "$REGISTRY/caption-ninja-web:$tag" -f "$work/web/Dockerfile" "$work" docker build -t "$REGISTRY/caption-ninja-relay:$tag" "$work/captionninja/relay" docker build -t "$REGISTRY/caption-ninja-stt:$tag" "$work/caption-local" echo echo "Built:" for image in web relay stt; do echo " $REGISTRY/caption-ninja-$image:$tag"; done