47 lines
1.5 KiB
Bash
Executable File
47 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Check the host prerequisites for the manual standalone installation path.
|
|
set -euo pipefail
|
|
|
|
fail() {
|
|
echo "check-standalone-prerequisites.sh: $*" >&2
|
|
exit 1
|
|
}
|
|
|
|
require_command() {
|
|
command -v "$1" >/dev/null 2>&1 || fail "required command is missing: $1"
|
|
}
|
|
|
|
require_command git
|
|
require_command docker
|
|
require_command bash
|
|
require_command curl
|
|
require_command openssl
|
|
require_command shasum
|
|
|
|
docker info >/dev/null 2>&1 || fail "Docker Engine is not reachable; start Docker Desktop or the Docker service"
|
|
|
|
compose_version=$(docker compose version --short 2>/dev/null) || {
|
|
fail "Docker Compose v2 is not available as 'docker compose'"
|
|
}
|
|
[[ -n "$compose_version" ]] || fail "Docker Compose returned no version"
|
|
|
|
server_arch=$(docker version --format '{{.Server.Arch}}' 2>/dev/null) || {
|
|
fail "could not determine the Docker server architecture"
|
|
}
|
|
server_arch_lower=$(printf '%s' "$server_arch" | tr '[:upper:]' '[:lower:]')
|
|
case "$server_arch_lower" in
|
|
amd64|x86_64|arm64|aarch64) ;;
|
|
*) fail "unsupported Docker server architecture: $server_arch (expected amd64 or arm64)" ;;
|
|
esac
|
|
|
|
printf 'Manual standalone prerequisites passed.\n'
|
|
printf ' Docker Compose: %s\n' "$compose_version"
|
|
printf ' Docker architecture: %s\n' "$server_arch"
|
|
printf ' Host shell: %s\n' "$(uname -s)/$(uname -m)"
|
|
|
|
if command -v tht >/dev/null 2>&1; then
|
|
printf ' tht: %s\n' "$(command -v tht)"
|
|
else
|
|
printf ' tht: not installed yet (run bash scripts/install-tht.sh next)\n'
|
|
fi
|