release.sh: correct the build prerequisites (builds are remote, not docker-local)
I had it wrong: `cloudron builder build` uploads the build context and the registry app's BuildKit builds it — the caller needs no docker, only a registry login. The guard now checks for that login and prints both bootstrap routes (narrow app password scoped to the registry app, or the CLI device flow) instead of blaming a missing docker binary.
This commit is contained in:
1 parent
2357d5d55a
commit
b657030d24
2 files changed
+26
-5
No files matched your search
+20
-1
@@ -39,9 +39,28 @@ cr() { cloudron --server "$SERVER" --token "$CLOUDRON_TOKEN" "$@"; }
|
||||
manifest_tag() { python3 -c "import json;print(json.load(open('$MANIFEST'))['dockerImage'].rsplit(':',1)[-1])"; }
|
||||
|
||||
cmd_build() {
|
||||
command -v docker >/dev/null || die "no docker on this host — builds run where docker + the registry login live, not on the agent VM"
|
||||
# Builds are REMOTE: the CLI uploads the build context and the registry's
|
||||
# BuildKit does the work (no docker on the caller). What is required is a
|
||||
# registry login for this user on this host — see the check below.
|
||||
local tag="${TAG:-$(date -u +%Y%m%d)-$(git rev-parse --short HEAD)}"
|
||||
[ -z "$(git status --porcelain)" ] || die "working tree is dirty — commit first, the tag carries the git sha"
|
||||
if ! cloudron builder info >/dev/null 2>&1; then
|
||||
die "no registry build config on this host (this is the only blocker to ./release.sh build)"
|
||||
fi
|
||||
if grep -qi "not logged in" <<<"$(cloudron builder info 2>&1 || true)"; then
|
||||
cat >&2 <<'MSG'
|
||||
release.sh: this host has no registry login, so it cannot start a remote build.
|
||||
Bootstrap it one of two ways:
|
||||
a) narrow: in the Cloudron dashboard, mint an app password for registry-bot
|
||||
scoped to the registry app (c257ba3c-6737-4375-ad51-ea19586bf3f0), put it on
|
||||
this host, then write into ~/.cloudron.json:
|
||||
{"builder": {"kind":"registry","type":"remote","url":"https://registry.inference.coop",
|
||||
"username":"registry-bot","token":"<app password>"}}
|
||||
b) broad: `cloudron login my.inference.coop` (device flow — a human with
|
||||
dashboard access confirms a code), then `cloudron builder login`.
|
||||
MSG
|
||||
exit 1
|
||||
fi
|
||||
printf 'building %s:%s (base %s)\n' "$REGISTRY_REPO" "$tag" "$BASE_IMAGE"
|
||||
cloudron builder build --no-cache --repository "$REGISTRY_REPO" --tag "$tag" || die "build failed"
|
||||
printf '\nbuilt tag: %s\nnext: ./release.sh pin %s\n' "$tag" "$tag"
|
||||
|
||||
Reference in new issue
Block a user