# vim: ft=dockerfile # # BackOne controller image: embedded controller on FileDB. # # ZT_CONTROLLER_NO_SQL=1 keeps PostgreSQL, Redis and the Rust smeeclient client # out of the build entirely, so no libpq-dev, no cargo toolchain and no # ext/*/install/ubuntu22.04/$(EXT_ARCH) prebuilts are needed -- any Debian base # works. See SPEC.md V21/V22. FROM debian:bookworm-slim AS builder RUN apt-get update -qq && \ apt-get install -y --no-install-recommends \ build-essential \ clang \ make \ libssl-dev \ pkg-config \ libminiupnpc-dev \ ca-certificates && \ rm -rf /var/lib/apt/lists/* WORKDIR /src COPY . . RUN make -j"$(nproc)" ZT_CONTROLLER=1 ZT_CONTROLLER_NO_SQL=1 one # V21: prove at build time that nothing from the SQL backends got in. RUN ! nm -C backone | grep -qiE 'pqxx|PostgreSQL::|sw::redis|smeeclient' FROM debian:bookworm-slim # libminiupnpc is a hard runtime dependency (ldd backone -> libminiupnpc.so.21); # openssl is required by the gate script's curl usage in CI images and left in # for operators debugging the control plane. No libpq5, no rust. RUN apt-get update -qq && \ apt-get install -y --no-install-recommends \ libminiupnpc17 \ iproute2 \ curl && \ rm -rf /var/lib/apt/lists/* COPY --from=builder /src/backone /usr/sbin/backone RUN ln -sf /usr/sbin/backone /usr/sbin/backone-cli && \ ln -sf /usr/sbin/backone /usr/sbin/backone-idtool ENV ZEROTIER_HOME=/var/lib/backone \ ZT_PID_FILE=backone.pid \ ZT_PORT_FILE=backone.port \ ZT_DAEMON=/usr/sbin/backone \ ZT_CLI=backone-cli # identity.secret + controller.d live here: replacing the container must not # change the node address or lose network state. VOLUME ["/var/lib/backone"] EXPOSE 9993 # -U skips the root check so the container need not run as uid 0, matching the # spec's "no privilege drop". The daemon runs in the foreground as PID 1. CMD ["/usr/sbin/backone", "-U", "-p9993"]