mirror of
https://codeberg.org/Toasterson/solstice-ci.git
synced 2026-04-10 13:20:41 +00:00
Fix orchestrator container: pre-built binary + Ubuntu 24.04 base
Switch to pre-built binary Containerfile to avoid workspace dependency issues with vm-manager path dep. Use Ubuntu 24.04 to match host glibc.
This commit is contained in:
parent
39509039e3
commit
21f4977839
2 changed files with 14 additions and 23 deletions
5
.cargo/config.toml
Normal file
5
.cargo/config.toml
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Cargo configuration for Solstice CI
|
||||||
|
# vm-manager is referenced via path dep in orchestrator's Cargo.toml.
|
||||||
|
# For local development, ensure the vm-manager repo is available at:
|
||||||
|
# ../vm-manager (relative to solstice-ci root)
|
||||||
|
# or create a symlink: ln -s /path/to/vm-manager ../vm-manager
|
||||||
|
|
@ -1,33 +1,19 @@
|
||||||
# syntax=docker/dockerfile:1.7
|
# syntax=docker/dockerfile:1.7
|
||||||
# Build Solstice Orchestrator using upstream official images
|
# Solstice Orchestrator container
|
||||||
# Uses vm-manager (direct QEMU) instead of libvirt — only needs /dev/kvm at runtime
|
# Uses vm-manager (direct QEMU) instead of libvirt — only needs /dev/kvm at runtime
|
||||||
|
#
|
||||||
|
# Pre-build the binary, then build the container:
|
||||||
|
# cargo build --release -p orchestrator
|
||||||
|
# docker build -f deploy/images/orchestrator/Containerfile -t local/solstice-orchestrator:latest .
|
||||||
|
|
||||||
FROM docker.io/library/rust:bookworm AS builder
|
FROM docker.io/library/ubuntu:24.04
|
||||||
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
|
# Runtime: QEMU for VMs, qemu-utils for qemu-img, DB client libs
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends \
|
&& apt-get install -y --no-install-recommends \
|
||||||
libsqlite3-0 libpq5 ca-certificates \
|
libsqlite3-0 libpq5 ca-certificates \
|
||||||
qemu-system-x86 qemu-utils \
|
qemu-system-x86 qemu-utils \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
COPY --from=builder /orchestrator /usr/local/bin/orchestrator
|
COPY target/release/orchestrator /usr/local/bin/solstice-orchestrator
|
||||||
|
RUN chmod +x /usr/local/bin/solstice-orchestrator
|
||||||
EXPOSE 8081
|
EXPOSE 8081
|
||||||
ENTRYPOINT ["/usr/local/bin/orchestrator"]
|
ENTRYPOINT ["/usr/local/bin/solstice-orchestrator"]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue