Two ways to build — standard Go or a fully static Docker binary
Requires Go 1.21+. Produces a native binary for your platform in seconds. Best for local development.
No Go required. Produces a fully static Linux/amd64 binary with no libc dependency. Runs anywhere.
go version.
# clone the repo $ git clone https://github.com/binRick/pal && cd pal # build $ go build -o pal . # install to PATH $ sudo mv pal /usr/local/bin/ # verify $ pal -h
$ go build -trimpath -ldflags="-s -w" -o pal . ~2.5 MB (palettes embedded)
golang:1.21-alpine image with CGO_ENABLED=0.
The output binary has zero dynamic library dependencies.
$ ./build.sh 🐳 Building static pal binary via Docker... ✅ Built: /path/to/pal/pal Size: 2.5M pal: ELF 64-bit LSB executable, x86-64, statically linked
#!/usr/bin/env bash set -euo pipefail docker run --rm \ -v "$(pwd)":/src \ -w /src \ -e CGO_ENABLED=0 \ -e GOOS=linux \ -e GOARCH=amd64 \ golang:1.21-alpine \ go build \ -trimpath \ -ldflags="-s -w -extldflags=-static" \ -o pal .
| Variable | Value | Effect |
|---|---|---|
| CGO_ENABLED | 0 | Disable cgo — required for fully static binary |
| GOOS | linux / darwin / windows | Target OS |
| GOARCH | amd64 / arm64 | Target architecture |
$ pal list | wc -l 420 $ pal list | grep dracula base16-dracula dracula-dark $ pal dracula-dark && echo "applied" applied # check static linking (Linux) $ file pal pal: ELF 64-bit LSB executable, x86-64, statically linked, stripped