#!/bin/sh # Build the OxygenFlow build image and write it as a root file system # tarball for `flow rootfs import`. Run from any directory; the Oxygen # projects are expected next to this repository (../oxygen, ../oxygenhub). # Rebuild whenever a Cargo.lock of those projects changes. set -eu here=$(cd "$(dirname "$0")" && pwd) dev=$(cd "$here/../../.." && pwd) out=${1:-$here/oxygenflow-build.tar} NODE_VERSION=24.21.0 NODE_SHA256=fd8e59d5a511510f6a298afb548f18c7d2b1be404d8b4a27d94fbe49f56cb2d6 rm -rf "$here/vendor" cargo vendor --locked --versioned-dirs \ --manifest-path "$dev/oxygen/Cargo.toml" \ --sync "$dev/oxygenhub/Cargo.toml" \ --sync "$dev/oxygenflow/Cargo.toml" \ "$here/vendor" >/dev/null docker build -q -t oxygenflow-build \ --build-arg NODE_VERSION=$NODE_VERSION --build-arg NODE_SHA256=$NODE_SHA256 "$here" id=$(docker create oxygenflow-build) docker export "$id" -o "$out" docker rm "$id" >/dev/null rm -rf "$here/vendor" echo "$out"