Cross-compiling zk
with Docker
Largely inspired by dh1tw and remoteAudio-xcompile. Images are when changes are pushed to the main branch using Actions.
You can compile the zk
source code directly from the source code directory. As example, for compiling the binary for linux/arm64 you have to execute the following command:
docker run --rm -v "$PWD":/usr/src/zk -w /usr/src/zk ghcr.io/zk-org/zk-xcompile:linux-arm64 /bin/bash -c 'make'
This call is already set in zk
Makefile
, e.g. make dist-linux-amd64
.
More detail is documented here on Golang's docker hub.
The images are hosted with ghcr within zk-org.
Clone this repo, make necessary changes, submit a PR.
docker buildx build -t ghcr.io/zk-org/zk-xcompile:linux-amd64 ./linux-amd64