#!/usr/bin/env bash # Runs a command inside the Void Linux builder container. # The project is mounted at /work; downloaded packages are cached in out/cache/xbps. # DASOS_OUT puts out/ elsewhere (CI keeps it between checkouts). set -euo pipefail root=$(cd "$(dirname "$0")/.." && pwd) out=${DASOS_OUT:-$root/out} image=dasos-builder docker build --quiet --tag "$image" "$root/docker/builder" >/dev/null mkdir -p "$out/cache/xbps" # --privileged: mklive mounts /proc, /sys, /dev and a loop device for the root image exec docker run --rm --privileged \ --volume "$root:/work" \ ${DASOS_OUT:+--volume "$out:/work/out"} \ --volume "$out/cache/xbps:/var/cache/xbps" \ --env HOST_UID="$(id -u)" \ --env HOST_GID="$(id -g)" \ --env DASOS_REBUILD \ "$image" "$@"