|
1 | 1 | # Cross-compiling [`zk`](https://github.com/zk-org/zk) with Docker |
2 | 2 |
|
3 | | -Largely inspired by [dh1tw](https://dh1tw.de/2019/12/cross-compiling-golang-cgo-projects/) and [remoteAudio-xcompile](https://github.com/dh1tw/remoteAudio-xcompile). |
4 | | -Images are when changes are pushed to the main branch using Actions. |
| 3 | +Largely inspired by |
| 4 | +[dh1tw](https://dh1tw.de/2019/12/cross-compiling-golang-cgo-projects/) and |
| 5 | +[remoteAudio-xcompile](https://github.com/dh1tw/remoteAudio-xcompile). |
| 6 | + |
| 7 | +Images are published to ghcr.io when changes are pushed or merged to main. |
5 | 8 |
|
6 | 9 | ## How to invoke? |
7 | 10 |
|
8 | | -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: |
| 11 | +You can compile the `zk` source code directly from the source code directory. As |
| 12 | +example, for compiling the binary for linux/arm64 you have to execute the |
| 13 | +following command: |
9 | 14 |
|
10 | 15 | ```sh |
11 | 16 | docker run --rm -v "$PWD":/usr/src/zk -w /usr/src/zk ghcr.io/zk-org/zk-xcompile:linux-arm64 /bin/bash -c 'make' |
12 | 17 | ``` |
13 | 18 |
|
14 | 19 | This call is already set in `zk` `Makefile`, e.g. `make dist-linux-amd64`. |
15 | 20 |
|
16 | | -More detail is documented here on [Golang's docker hub](https://hub.docker.com/_/golang). |
| 21 | +More detail is documented here on |
| 22 | +[Golang's docker hub](https://hub.docker.com/_/golang). |
17 | 23 |
|
18 | | -The images are hosted with [ghcr within zk-org](https://github.com/orgs/zk-org/packages/container/zk-xcompile/versions). |
| 24 | +The images are hosted with |
| 25 | +[ghcr within zk-org](https://github.com/orgs/zk-org/packages/container/zk-xcompile/versions). |
19 | 26 |
|
20 | 27 | ## Releasing changes |
21 | 28 |
|
22 | | -Clone this repo, make necessary changes, submit a PR. |
| 29 | +Clone this repo, make necessary changes, submit a PR. |
23 | 30 |
|
24 | 31 | ### Manual building |
25 | 32 |
|
26 | 33 | ```sh |
27 | 34 | docker buildx build -t ghcr.io/zk-org/zk-xcompile:linux-amd64 ./linux-amd64 |
28 | 35 | ``` |
29 | | - |
|
0 commit comments