Build from local KamadoPool checkout via buildx build-context
Replaces the git-clone-at-SHA source stage with a 'FROM scratch AS source' stage that COPYs from a named build context. The Makefile passes '--build-context kamado=../KamadoPool' by default; override with 'make KAMADO_SRC=/elsewhere'. No more SHA placeholder, no GitHub dependency, no re-clone on every build — and the image always reflects the working tree.
This commit is contained in:
+12
-19
@@ -2,31 +2,24 @@
|
|||||||
#
|
#
|
||||||
# Kamado Pool StartOS package image.
|
# Kamado Pool StartOS package image.
|
||||||
#
|
#
|
||||||
# Clones the KamadoPool repo at a pinned SHA, then inlines the ckpool,
|
# KamadoPool source is supplied via a named build context so the image
|
||||||
# ui, and api build stages (mirroring ckpool/Dockerfile and api/Dockerfile
|
# is built from the local checkout (no GitHub, no pinned SHA). The
|
||||||
# in the upstream repo). Final runtime image has both binaries plus the
|
# Makefile passes `--build-context kamado=../KamadoPool` — adjust if
|
||||||
# StartOS entrypoint that supervises them.
|
# your checkout lives elsewhere.
|
||||||
#
|
#
|
||||||
# TODO: set KAMADO_SHA to a real pushed commit before running `make`.
|
# After the source stage, the ckpool/ui/api build steps mirror the
|
||||||
# The placeholder below is a valid 40-char hex string to keep tooling
|
# stages in KamadoPool's own ckpool/Dockerfile and api/Dockerfile.
|
||||||
# happy but the clone checkout will fail until this is updated.
|
|
||||||
|
|
||||||
ARG KAMADO_REPO=https://github.com/Relaxo143/KamadoPool.git
|
|
||||||
ARG KAMADO_SHA=0000000000000000000000000000000000000000
|
|
||||||
ARG CKPOOL_REPO=https://bitbucket.org/ckolivas/ckpool.git
|
ARG CKPOOL_REPO=https://bitbucket.org/ckolivas/ckpool.git
|
||||||
ARG CKPOOL_COMMIT=cfb0f83b70d7b382b85d2bd0710cf4cb2dda4007
|
ARG CKPOOL_COMMIT=cfb0f83b70d7b382b85d2bd0710cf4cb2dda4007
|
||||||
ARG ARCH
|
ARG ARCH
|
||||||
|
|
||||||
# ---------- stage 1: fetch Kamado source ----------
|
# ---------- stage 1: materialize Kamado source ----------
|
||||||
FROM debian:bookworm-slim AS source
|
# `kamado` is a named build context — the Makefile passes
|
||||||
ARG KAMADO_REPO
|
# --build-context kamado=../KamadoPool so this COPY pulls directly
|
||||||
ARG KAMADO_SHA
|
# from the local checkout.
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
FROM scratch AS source
|
||||||
git ca-certificates \
|
COPY --from=kamado . /src/kamado/
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
WORKDIR /src
|
|
||||||
RUN git clone "${KAMADO_REPO}" kamado \
|
|
||||||
&& cd kamado && git checkout "${KAMADO_SHA}"
|
|
||||||
|
|
||||||
# ---------- stage 2: build patched ckpool ----------
|
# ---------- stage 2: build patched ckpool ----------
|
||||||
# Mirrors KamadoPool/ckpool/Dockerfile: clones upstream ckpool at the
|
# Mirrors KamadoPool/ckpool/Dockerfile: clones upstream ckpool at the
|
||||||
|
|||||||
@@ -19,10 +19,13 @@ $(PKG_ID).s9pk: manifest.yaml instructions.md icon.png LICENSE scripts/embassy.j
|
|||||||
scripts/embassy.js: $(TS_FILES)
|
scripts/embassy.js: $(TS_FILES)
|
||||||
deno run --allow-read --allow-write --allow-env --allow-net scripts/bundle.ts
|
deno run --allow-read --allow-write --allow-env --allow-net scripts/bundle.ts
|
||||||
|
|
||||||
|
KAMADO_SRC ?= ../KamadoPool
|
||||||
|
|
||||||
image.tar: Dockerfile docker_entrypoint.sh
|
image.tar: Dockerfile docker_entrypoint.sh
|
||||||
docker buildx build --tag start9/$(PKG_ID)/main:$(PKG_VERSION) \
|
docker buildx build --tag start9/$(PKG_ID)/main:$(PKG_VERSION) \
|
||||||
--platform=linux/arm64/v8,linux/amd64 \
|
--platform=linux/arm64/v8,linux/amd64 \
|
||||||
--build-arg ARCH=$(shell uname -m) \
|
--build-arg ARCH=$(shell uname -m) \
|
||||||
|
--build-context kamado=$(KAMADO_SRC) \
|
||||||
-o type=oci,dest=image.tar .
|
-o type=oci,dest=image.tar .
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|||||||
@@ -10,7 +10,11 @@ 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 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`.
|
||||||
|
|
||||||
> **Note:** the Dockerfile clones the Kamado source from a pinned git SHA. Before the first build, set the `KAMADO_REPO` and `KAMADO_SHA` build args in [Dockerfile](Dockerfile) to a real pushed commit on the upstream repo.
|
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:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
make KAMADO_SRC=/path/to/KamadoPool
|
||||||
|
```
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user