Add cross-compilation, Linux binary build, and systemd service installer

- Dockerfile.cross: builds static x86_64 musl binary from macOS via Docker
- scripts/build-linux.sh: one-command cross-compilation
- scripts/install-service.sh: systemd service with security hardening
- Bump Rust Docker images to 1.86 for edition2024 support

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-03-31 12:52:20 +04:00
parent d9007dc169
commit e604fdb2e7
5 changed files with 157 additions and 1 deletions

17
scripts/build-linux.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Build a static x86_64 Linux binary using Docker (works from macOS)
set -euo pipefail
cd "$(dirname "$0")/.."
echo "=== Building x86_64 Linux binary via Docker ==="
DOCKER_BUILDKIT=1 docker build \
-f Dockerfile.cross \
--output type=local,dest=./dist \
.
ls -lh dist/btest
file dist/btest
echo ""
echo "Binary ready at: dist/btest"
echo "Copy to your server: scp dist/btest user@server:/usr/local/bin/btest"