build: UPX compression — binary 6.9MB → 2.1MB (70% smaller)

UPX with --best --lzma compresses the Go binary for distribution.
Integrated into Makefile targets (fallback if upx not installed).
This commit is contained in:
admin 2026-08-01 14:33:36 +00:00
parent c64f12a360
commit 67d9a6a7d8
3 changed files with 4 additions and 1 deletions

1
.gitignore vendored
View file

@ -10,3 +10,4 @@ Thumbs.db
notes/
wallarm
bin/
wallarm-upx

View file

@ -12,9 +12,11 @@ all: linux-amd64 linux-arm64
linux-amd64:
GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o $(BINARY)-linux-amd64 ./cmd/wallarm/
upx --best --lzma $(BINARY)-linux-amd64 -o $(BINARY)-linux-amd64.tmp 2>/dev/null && mv $(BINARY)-linux-amd64.tmp $(BINARY)-linux-amd64 || true
linux-arm64:
GOOS=linux GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o $(BINARY)-linux-arm64 ./cmd/wallarm/
upx --best --lzma $(BINARY)-linux-arm64 -o $(BINARY)-linux-arm64.tmp 2>/dev/null && mv $(BINARY)-linux-arm64.tmp $(BINARY)-linux-arm64 || true
clean:
rm -f $(BINARY) $(BINARY)-linux-*

View file

@ -16,7 +16,7 @@ That's it. The binary runs preflight checks, then opens an interactive TUI:
## Features
- **Single binary**7MB, zero runtime dependencies, works on any Linux
- **Single binary**2MB, zero runtime dependencies, works on any Linux
- **Interactive TUI** — bubbletea-powered forms and dashboard
- **Preflight checks** — runs on every start: system, network, cloud reachability, resources
- **Multi-node** — manage multiple Wallarm nodes on the same host via systemd