mirror of
https://codeberg.org/Toasterson/solstice-ci.git
synced 2026-04-10 13:20:41 +00:00
- Remove libvirt-dev from build stage, libvirt-clients/libvirt0 from runtime - Remove genisoimage (vm-manager has pure-Rust ISO builder) - Add qemu-system-x86 to runtime for direct VM execution - Keep qemu-utils for qemu-img overlay creation - Remove --features libvirt from cargo build - Remove libvirt socket/config volume mounts from compose.yml - Remove LIBVIRT_URI/LIBVIRT_NETWORK env vars - Add optional NETWORK_BRIDGE env var for TAP mode - Container now only needs /dev/kvm device access
33 lines
1.5 KiB
Docker
33 lines
1.5 KiB
Docker
# syntax=docker/dockerfile:1.7
|
|
# Build Solstice Orchestrator using upstream official images
|
|
# Uses vm-manager (direct QEMU) instead of libvirt — only needs /dev/kvm at runtime
|
|
|
|
FROM docker.io/library/rust:bookworm AS builder
|
|
ENV CARGO_HOME=/cargo
|
|
WORKDIR /work
|
|
# Install build dependencies: protoc, DB headers, pkg-config
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
protobuf-compiler libprotobuf-dev pkg-config libsqlite3-dev libpq-dev ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
# Configure cargo target-dir so it can be cached between layers
|
|
RUN mkdir -p /cargo && printf "[build]\ntarget-dir = \"/cargo/target\"\n" > /cargo/config.toml
|
|
# Pre-copy manifests for better caching
|
|
COPY Cargo.toml ./
|
|
COPY crates ./crates
|
|
# Build orchestrator (no libvirt feature needed — uses vm-manager QEMU backend)
|
|
RUN --mount=type=cache,target=/cargo/registry,sharing=locked \
|
|
--mount=type=cache,target=/cargo/git,sharing=locked \
|
|
--mount=type=cache,target=/cargo/target,sharing=locked \
|
|
cargo build --release -p orchestrator && cp /cargo/target/release/orchestrator /orchestrator
|
|
|
|
FROM docker.io/library/debian:bookworm-slim
|
|
# Runtime: QEMU for VMs, qemu-utils for qemu-img, DB client libs
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
libsqlite3-0 libpq5 ca-certificates \
|
|
qemu-system-x86 qemu-utils \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
COPY --from=builder /orchestrator /usr/local/bin/orchestrator
|
|
EXPOSE 8081
|
|
ENTRYPOINT ["/usr/local/bin/orchestrator"]
|