| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- FROM debian:13-slim
- ARG REPO_USER
- ARG REPO_PASS
- ENV DEBIAN_FRONTEND=noninteractive
- RUN apt-get update && apt-get install -y --no-install-recommends \
- ca-certificates curl gnupg cmake ninja-build g++ pkg-config git \
- nlohmann-json3-dev libspdlog-dev libfmt-dev libssl-dev libsystemd-dev \
- libidn2-dev \
- protobuf-compiler libprotobuf-dev libgrpc++-dev protobuf-compiler-grpc \
- && rm -rf /var/lib/apt/lists/*
- # libidn2-dev is here so the VENDORED curl really gets IDN, which control.runner
- # has always DECLARED (`libidn2-0`) and this file's own note called a deliberate
- # trade: "mail hostnames are usually ASCII, but breaking an internationalised one
- # to save a dependency is the wrong trade." Measured 2026-10-22 and the trade was
- # never actually made - without this package curl's configure logged "Package
- # 'libidn2' ... not found" and reported `Features: AsynchDNS IPv6 Largefile SSL
- # threadsafe UnixSockets` with no IDN, while `objdump -p` on the shipped runner
- # showed no libidn2 among its NEEDED libraries. So the hand-written Depends line
- # was evidence of INTENT and was read as evidence of fact, and an
- # internationalised mail hostname would have failed with nothing explaining why.
- # Verify after any base rebuild by reading curl's own `-- Features:` line from
- # the build log, never the Depends list.
- #
- # Note: the gRPC/protobuf dev packages above are required so that the cmake
- # config shipped by libsmartbotic-db-client-dev can resolve `find_dependency(gRPC
- # CONFIG)`. Without protobuf-compiler-grpc, trixie's gRPCTargets.cmake references
- # plugin files that aren't present and find_package fails fatally (before the
- # pkg-config fallback). Mirrors smartbotic-database's build base.
- # Node 22 for the web UI build (vite 7 needs node >=20.19/22).
- RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
- && apt-get install -y --no-install-recommends nodejs \
- && rm -rf /var/lib/apt/lists/*
- # Smartbotics apt repo - provides libsmartbotic-db-client-dev.
- #
- # The client version is PINNED on purpose. vectorapi links
- # libsmartbotic-db-client.so, and every 2.x shares one SONAME, so a deb built
- # against a newer client installs happily next to an older one on the target and
- # only segfaults on the next service restart. Keep this equal to the client
- # version installed on the deploy target; when the target's DB moves, bump this
- # and ship both together.
- ARG DB_CLIENT_VERSION=2.20.0-1
- # Publishing a new client re-indexes the apt pool, so the pinned version is
- # often no longer installable from the repo. build.sh copies the matching .debs
- # here from DEB_REPO_DIR when it finds them; an empty dir falls back to apt.
- COPY packaging/vendor/ /tmp/db-client-vendor/
- RUN curl -fsSL https://repository.smartbotics.ai/smartbotics-repo.gpg \
- | gpg --dearmor -o /usr/share/keyrings/smartbotics-repo.gpg \
- && printf 'machine repository.smartbotics.ai\nlogin %s\npassword %s\n' "$REPO_USER" "$REPO_PASS" \
- > /etc/apt/auth.conf.d/smartbotics.conf \
- && chmod 600 /etc/apt/auth.conf.d/smartbotics.conf \
- && echo "deb [signed-by=/usr/share/keyrings/smartbotics-repo.gpg] https://repository.smartbotics.ai trixie main" \
- > /etc/apt/sources.list.d/smartbotics.list \
- && apt-get update \
- && if ls /tmp/db-client-vendor/*.deb >/dev/null 2>&1; then \
- apt-get install -y --no-install-recommends /tmp/db-client-vendor/*.deb; \
- else \
- apt-get install -y --no-install-recommends \
- "libsmartbotic-db-client-dev=${DB_CLIENT_VERSION}" \
- "libsmartbotic-db-client=${DB_CLIENT_VERSION}"; \
- fi \
- && dpkg-query -W -f='pinned client: ${Package} ${Version}\n' libsmartbotic-db-client \
- && rm -rf /var/lib/apt/lists/* /tmp/db-client-vendor
|