Commit c0849b6
feat(node): official kth node Docker image + GHCR publish workflow (#2)
* feat(node): add kth full node image and GHCR publish workflow
Adds the first official Docker image of the kth node, alongside the existing base/ and gcc/ toolchain images.
node/Dockerfile builds FROM the kthnode/gcc15-ubuntu24.04 toolchain and installs kth via 'conan install --requires=kth/<version> --deployer=direct_deploy --build=missing'. The kth package and its heavy dependencies are pulled prebuilt from packages.kth.cash; only pieces without a matching prebuilt for this profile (currently utxoz) are compiled, ~1-2 min. The runtime stage is a slim ubuntu:24.04 (~103 MB) carrying only the GCC 15 C++ runtime, the CA bundle and the kth binary, so it needs no package manager.
build-node.yml is a reusable (workflow_call) + manually dispatchable workflow that builds node/ for a given version and pushes ghcr.io/<owner>/kth:<version> and :latest, authenticating with the built-in GITHUB_TOKEN (no secrets required).
* fix(node): run as non-root and harden the publish workflow
Addresses review feedback:
- Dockerfile: add an unprivileged 'kth' user, own /data, and USER kth before the entrypoint instead of running the node as root.
- build-node.yml: validate the version input against a strict pattern via an env var (avoids shell injection from workflow inputs) and set persist-credentials: false on checkout.
Action refs and the toolchain tag are kept as-is for consistency with the existing knuth.yml workflow and the repo's :latest toolchain convention.
* fix(ci): reject version build-metadata that is not a valid Docker tag
Drop '+' from the accepted version pattern: Docker tags allow only [A-Za-z0-9_.-], so a value like 1.0.0+meta would pass validation but fail at push time. Reject it up front instead.
* rename node/ → kth/ and align action versions
- Move node/Dockerfile to kth/Dockerfile so the directory name matches
the published image (ghcr.io/k-nuth/kth) and the project naming
convention elsewhere in the org.
- Update build context in build-node.yml accordingly.
- Bump pinned action versions:
actions/checkout v4 → v7
docker/setup-buildx-action v3 → v4
docker/login-action v3 → v4
docker/build-push-action v6 → v7
* address remaining CodeRabbit comments on the node image
- Tighten the version regex: only `-` may introduce a prerelease
suffix. `1.2.3.rc1` (dot-separated) used to slip past the guard and
fail later in conan; now it's rejected up front.
- Skip the `:latest` tag for prereleases. An `-rc.N` build no longer
displaces the stable `:latest` — only X.Y.Z without a `-` suffix
publishes `:latest`.
- Pin the toolchain image by sha256 digest instead of `:latest`. A
future retag of `gcc15-ubuntu24.04:latest` would otherwise silently
change the binaries we produce. Bump the digest deliberately when
the toolchain moves.
- Fix a stale comment that still pointed at `node/` after the rename
to `kth/`.
---------
Co-authored-by: CyberAshven <cyberashven@users.noreply.github.com>
Co-authored-by: Fernando Pelliccioni <fpelliccioni@gmail.com>1 parent 6bd66e8 commit c0849b6
2 files changed
Lines changed: 170 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
0 commit comments