#!/usr/bin/env bash # 从构建出的镜像里取出 moshiro-agent 和 fleet-enroll,不挂载镜像: # buildah unshare / mount 在 CI 主机上报 memfd_create: Invalid argument,而导出 OCI 归档不需要挂载(工具链归档也是这样做的)。 set -euo pipefail image="${1:?usage: extract-node-binaries.sh }" destination="${2:?}" root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" work="$(mktemp -d)" trap 'rm -rf "$work"' EXIT buildah push --format oci "$image" "oci-archive:$work/image.tar" python3 "$root/ci/extract-oci-files.py" "$work/image.tar" "$destination" out/agent/moshiro-agent out/enroll/fleet-enroll