Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
18 lines
725 B
Bash
Executable File
18 lines
725 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Usage: container.sh <command...>; runs it in Ubuntu 26.04.
|
|
set -euo pipefail
|
|
|
|
root=$(cd "$(dirname "$0")/../.." && pwd)
|
|
[ $# -gt 0 ] || {
|
|
echo "container.sh: give a command, such as scripts/build-libreoffice.sh" >&2
|
|
exit 1
|
|
}
|
|
image=ely-office-linux-build
|
|
docker build -q -t "$image" "$root/packaging/linux" >/dev/null
|
|
# Own target and Cargo home: host builds need newer glibc.
|
|
mkdir -p "$root/target/ubuntu" "$root/target/ubuntu-cargo" "$root/target/ubuntu-home"
|
|
docker run --rm --user "$(id -u):$(id -g)" -v "$root:$root" -w "$root" \
|
|
-e HOME="$root/target/ubuntu-home" -e CARGO_HOME="$root/target/ubuntu-cargo" \
|
|
-e CARGO_TARGET_DIR="$root/target/ubuntu" -e ELY_RELEASE_TOKEN \
|
|
"$image" "$@"
|