51 lines
2.0 KiB
Docker
51 lines
2.0 KiB
Docker
# Runtime image for the tines service. Two stages: a build stage that
|
|
# compiles the workspace crates, and a slim runtime with the release
|
|
# binaries. The same image serves both fleet-console modes — BT mode adds
|
|
# --privileged / host networking / D-Bus plumbing at `docker run` time
|
|
# (Task 7), and bus mode just points the config at a host bus socket.
|
|
|
|
# ---- build ---------------------------------------------------------------
|
|
FROM ubuntu:24.04 AS build
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
build-essential pkg-config cmake curl ca-certificates \
|
|
libclang-dev clang libdbus-1-dev libudev-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Minimal rustup: default host, no extra targets or toolchains.
|
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
|
|
| sh -s -- -y --profile minimal
|
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
|
|
|
WORKDIR /workspace
|
|
|
|
# The workspace manifest and every member crate dir (all members' manifests
|
|
# must be present for cargo to resolve the workspace).
|
|
COPY Cargo.toml Cargo.lock ./
|
|
COPY tines-core ./tines-core
|
|
COPY tines-store ./tines-store
|
|
COPY tines-bt ./tines-bt
|
|
COPY tines-bus ./tines-bus
|
|
COPY tines-sim ./tines-sim
|
|
COPY tines-ros2 ./tines-ros2
|
|
COPY tines ./tines
|
|
|
|
RUN cargo build --release -p tines -p tines-bus
|
|
|
|
# ---- runtime --------------------------------------------------------------
|
|
FROM ubuntu:24.04
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
libdbus-1-3 libudev1 bluez dbus \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=build /workspace/target/release/tines /usr/local/bin/
|
|
COPY --from=build /workspace/target/release/tines-busd /usr/local/bin/
|
|
|
|
# The container command is the pinned argv from the fleet console:
|
|
# `tines /data/config.json` — the binary comes first because the service
|
|
# reads the config path from argv[1]. No ENTRYPOINT (it would swallow the
|
|
# argv); no default CMD (a bare `docker run` without the command is an
|
|
# error, which is what we want).
|
|
|