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.
|
||||
#
|
||||
# Clones the KamadoPool repo at a pinned SHA, then inlines the ckpool,
|
||||
# ui, and api build stages (mirroring ckpool/Dockerfile and api/Dockerfile
|
||||
# in the upstream repo). Final runtime image has both binaries plus the
|
||||
# StartOS entrypoint that supervises them.
|
||||
# KamadoPool source is supplied via a named build context so the image
|
||||
# is built from the local checkout (no GitHub, no pinned SHA). The
|
||||
# Makefile passes `--build-context kamado=../KamadoPool` — adjust if
|
||||
# your checkout lives elsewhere.
|
||||
#
|
||||
# TODO: set KAMADO_SHA to a real pushed commit before running `make`.
|
||||
# The placeholder below is a valid 40-char hex string to keep tooling
|
||||
# happy but the clone checkout will fail until this is updated.
|
||||
# After the source stage, the ckpool/ui/api build steps mirror the
|
||||
# stages in KamadoPool's own ckpool/Dockerfile and api/Dockerfile.
|
||||
|
||||
ARG KAMADO_REPO=https://github.com/Relaxo143/KamadoPool.git
|
||||
ARG KAMADO_SHA=0000000000000000000000000000000000000000
|
||||
ARG CKPOOL_REPO=https://bitbucket.org/ckolivas/ckpool.git
|
||||
ARG CKPOOL_COMMIT=cfb0f83b70d7b382b85d2bd0710cf4cb2dda4007
|
||||
ARG ARCH
|
||||
|
||||
# ---------- stage 1: fetch Kamado source ----------
|
||||
FROM debian:bookworm-slim AS source
|
||||
ARG KAMADO_REPO
|
||||
ARG KAMADO_SHA
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
git ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
WORKDIR /src
|
||||
RUN git clone "${KAMADO_REPO}" kamado \
|
||||
&& cd kamado && git checkout "${KAMADO_SHA}"
|
||||
# ---------- stage 1: materialize Kamado source ----------
|
||||
# `kamado` is a named build context — the Makefile passes
|
||||
# --build-context kamado=../KamadoPool so this COPY pulls directly
|
||||
# from the local checkout.
|
||||
FROM scratch AS source
|
||||
COPY --from=kamado . /src/kamado/
|
||||
|
||||
# ---------- stage 2: build patched ckpool ----------
|
||||
# Mirrors KamadoPool/ckpool/Dockerfile: clones upstream ckpool at the
|
||||
|
||||
Reference in New Issue
Block a user