Add multiarch build setup and build documentation

- Add `make setup` target to register qemu and create a multiplatform
  buildx builder for universal (x86_64 + aarch64) packages
- Use named builder with --progress=plain to avoid flickering output
- Conditionally depend on arch-specific Docker tars so single-arch
  builds don't require the other image
- Document prerequisites, build targets, and overrides in README
This commit is contained in:
satoshi
2026-05-19 03:01:46 +03:00
parent a068afc8c1
commit 57ec696e3f
2 changed files with 65 additions and 14 deletions
+40 -8
View File
@@ -2,25 +2,57 @@
StartOS 0.3.5.1 wrapper for [Kamado Pool](https://github.com/Relaxo143/KamadoPool), a modern solo Bitcoin mining pool built on a patched fork of CKPool-solo with a Go middleware API and Svelte real-time dashboard.
## Build
## Prerequisites
- **Docker** with [buildx](https://docs.docker.com/build/buildx/) plugin
- **deno** — bundles the TypeScript embassy procedures
- **yq** — parses `manifest.yaml` for package metadata
- **start-sdk** — packs and verifies the `.s9pk` (from the [StartOS SDK](https://docs.start9.com/latest/developer-docs/specification/))
- **KamadoPool source** — local sibling checkout at `../KamadoPool` (override with `KAMADO_SRC=/path/to/KamadoPool`)
## Building
### Universal package (x86_64 + aarch64)
A universal `.s9pk` runs on any StartOS machine regardless of architecture. This is the default and what you should ship.
**One-time setup** (re-run after each reboot):
```sh
make setup
```
This registers qemu binfmt handlers for cross-architecture emulation and creates a multiplatform Docker buildx builder. The arm64 build runs under emulation on x86 hosts, so it is significantly slower (~5-10x) than native.
**Build:**
```sh
make
```
This runs `deno` to bundle the embassy TypeScript procedures, builds a multi-arch OCI image via `docker buildx`, and packs everything into `kamado-pool.s9pk` using `start-sdk`.
This bundles the TypeScript procedures, builds Docker images for both architectures, and packs `kamado-pool.s9pk`. The universal package is roughly double the size of a single-arch package since it contains two Docker images.
The build pulls KamadoPool source from a **local sibling checkout** (`../KamadoPool` by default) via a docker buildx named build context — no GitHub clone, no pinned SHA. If your checkout lives elsewhere, override it:
### Single-arch (development)
For faster iteration when you only need one architecture:
```sh
make x86 # x86_64 only
make arm # aarch64 only
```
These skip the other architecture entirely — no emulation overhead.
### Overrides
```sh
# Use a different KamadoPool source directory
make KAMADO_SRC=/path/to/KamadoPool
# Use a different buildx builder
make BUILDER=my-builder
```
## Install
```sh
make install
```
## License