| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- 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 \
- protobuf-compiler libprotobuf-dev libgrpc++-dev protobuf-compiler-grpc \
- && rm -rf /var/lib/apt/lists/*
- # 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.11.1-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
|