Dockerfile.base 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. FROM debian:13-slim
  2. ARG REPO_USER
  3. ARG REPO_PASS
  4. ENV DEBIAN_FRONTEND=noninteractive
  5. RUN apt-get update && apt-get install -y --no-install-recommends \
  6. ca-certificates curl gnupg cmake ninja-build g++ pkg-config git \
  7. nlohmann-json3-dev libspdlog-dev libfmt-dev libssl-dev libsystemd-dev \
  8. protobuf-compiler libprotobuf-dev libgrpc++-dev protobuf-compiler-grpc \
  9. && rm -rf /var/lib/apt/lists/*
  10. # Note: the gRPC/protobuf dev packages above are required so that the cmake
  11. # config shipped by libsmartbotic-db-client-dev can resolve `find_dependency(gRPC
  12. # CONFIG)`. Without protobuf-compiler-grpc, trixie's gRPCTargets.cmake references
  13. # plugin files that aren't present and find_package fails fatally (before the
  14. # pkg-config fallback). Mirrors smartbotic-database's build base.
  15. # Node 22 for the web UI build (vite 7 needs node >=20.19/22).
  16. RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
  17. && apt-get install -y --no-install-recommends nodejs \
  18. && rm -rf /var/lib/apt/lists/*
  19. # Smartbotics apt repo - provides libsmartbotic-db-client-dev.
  20. #
  21. # The client version is PINNED on purpose. vectorapi links
  22. # libsmartbotic-db-client.so, and every 2.x shares one SONAME, so a deb built
  23. # against a newer client installs happily next to an older one on the target and
  24. # only segfaults on the next service restart. Keep this equal to the client
  25. # version installed on the deploy target; when the target's DB moves, bump this
  26. # and ship both together.
  27. ARG DB_CLIENT_VERSION=2.11.3-1
  28. # Publishing a new client re-indexes the apt pool, so the pinned version is
  29. # often no longer installable from the repo. build.sh copies the matching .debs
  30. # here from DEB_REPO_DIR when it finds them; an empty dir falls back to apt.
  31. COPY packaging/vendor/ /tmp/db-client-vendor/
  32. RUN curl -fsSL https://repository.smartbotics.ai/smartbotics-repo.gpg \
  33. | gpg --dearmor -o /usr/share/keyrings/smartbotics-repo.gpg \
  34. && printf 'machine repository.smartbotics.ai\nlogin %s\npassword %s\n' "$REPO_USER" "$REPO_PASS" \
  35. > /etc/apt/auth.conf.d/smartbotics.conf \
  36. && chmod 600 /etc/apt/auth.conf.d/smartbotics.conf \
  37. && echo "deb [signed-by=/usr/share/keyrings/smartbotics-repo.gpg] https://repository.smartbotics.ai trixie main" \
  38. > /etc/apt/sources.list.d/smartbotics.list \
  39. && apt-get update \
  40. && if ls /tmp/db-client-vendor/*.deb >/dev/null 2>&1; then \
  41. apt-get install -y --no-install-recommends /tmp/db-client-vendor/*.deb; \
  42. else \
  43. apt-get install -y --no-install-recommends \
  44. "libsmartbotic-db-client-dev=${DB_CLIENT_VERSION}" \
  45. "libsmartbotic-db-client=${DB_CLIENT_VERSION}"; \
  46. fi \
  47. && dpkg-query -W -f='pinned client: ${Package} ${Version}\n' libsmartbotic-db-client \
  48. && rm -rf /var/lib/apt/lists/* /tmp/db-client-vendor