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:
17
scripts/build-linux.sh
Executable file
17
scripts/build-linux.sh
Executable 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"
|
||||
Reference in New Issue
Block a user