mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-15 09:01:31 +00:00
refactor: update Dockerfile and build artifacts for spinifex rename
- Dockerfile.distro: update all paths from hive → spinifex - Binary output name: spx - Logrotate: logrotate-spinifex
This commit is contained in:
+14
-14
@@ -11,38 +11,38 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
WORKDIR /build
|
||||
|
||||
# Copy module files for dependency caching
|
||||
COPY hive/go.mod hive/go.sum ./hive/
|
||||
COPY spinifex/go.mod spinifex/go.sum ./spinifex/
|
||||
COPY predastore/go.mod predastore/go.sum ./predastore/
|
||||
COPY viperblock/go.mod viperblock/go.sum ./viperblock/
|
||||
COPY viperblock/nbd/go.mod viperblock/nbd/go.sum ./viperblock/nbd/
|
||||
COPY viperblock/nbd/libguestfs.org/nbdkit/go.mod ./viperblock/nbd/libguestfs.org/nbdkit/
|
||||
|
||||
# Generate go.work (gitignored, so not in checkout)
|
||||
RUN cd hive && go work init . ../predastore ../viperblock ../viperblock/nbd ../viperblock/nbd/libguestfs.org/nbdkit
|
||||
RUN cd spinifex && go work init . ../predastore ../viperblock ../viperblock/nbd ../viperblock/nbd/libguestfs.org/nbdkit
|
||||
|
||||
# Download dependencies (cached layer)
|
||||
RUN cd hive && go mod download
|
||||
RUN cd spinifex && go mod download
|
||||
|
||||
# Copy full source
|
||||
COPY hive/ ./hive/
|
||||
COPY spinifex/ ./spinifex/
|
||||
COPY predastore/ ./predastore/
|
||||
COPY viperblock/ ./viperblock/
|
||||
|
||||
# Build hive binary
|
||||
RUN COMMIT=$(cd hive && git rev-parse --short HEAD 2>/dev/null || echo "unknown") && \
|
||||
cd hive && go build -ldflags "-s -w \
|
||||
-X github.com/mulgadc/hive/cmd/hive/cmd.Version=${VERSION} \
|
||||
-X github.com/mulgadc/hive/cmd/hive/cmd.Commit=${COMMIT}" \
|
||||
-o /out/hive cmd/hive/main.go
|
||||
# Build spinifex binary (spx)
|
||||
RUN COMMIT=$(cd spinifex && git rev-parse --short HEAD 2>/dev/null || echo "unknown") && \
|
||||
cd spinifex && go build -ldflags "-s -w \
|
||||
-X github.com/mulgadc/spinifex/cmd/spinifex/cmd.Version=${VERSION} \
|
||||
-X github.com/mulgadc/spinifex/cmd/spinifex/cmd.Commit=${COMMIT}" \
|
||||
-o /out/spx cmd/spinifex/main.go
|
||||
|
||||
# Build nbdkit viperblock plugin (.so)
|
||||
RUN cd viperblock && go build -o /out/nbdkit-viperblock-plugin.so -buildmode=c-shared nbd/viperblock.go
|
||||
|
||||
# Copy setup scripts and systemd units
|
||||
RUN cp hive/scripts/setup.sh /out/setup.sh 2>/dev/null || true
|
||||
RUN cp hive/scripts/setup-ovn.sh /out/setup-ovn.sh
|
||||
RUN mkdir -p /out/systemd && cp hive/build/systemd/* /out/systemd/
|
||||
RUN cp hive/build/logrotate/hive /out/logrotate-hive
|
||||
RUN cp spinifex/scripts/setup.sh /out/setup.sh 2>/dev/null || true
|
||||
RUN cp spinifex/scripts/setup-ovn.sh /out/setup-ovn.sh
|
||||
RUN mkdir -p /out/systemd && cp spinifex/build/systemd/* /out/systemd/
|
||||
RUN cp spinifex/build/logrotate/spinifex /out/logrotate-spinifex
|
||||
|
||||
FROM scratch AS export
|
||||
COPY --from=builder /out/ /
|
||||
|
||||
Reference in New Issue
Block a user