Dockerfile.base 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # smartbotic-automation Build Base Image
  2. # Pre-installed Debian 13 build dependencies for fast iterative builds.
  3. #
  4. # Build:
  5. # docker buildx build -f packaging/Dockerfile.base \
  6. # --build-arg REPO_PASS=<password> \
  7. # -t smartbotic-automation-build-base:debian13 .
  8. FROM debian:trixie
  9. ENV DEBIAN_FRONTEND=noninteractive
  10. RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
  11. && rm -rf /var/lib/apt/lists/*
  12. # SmartBotics APT repository (for libsmartbotic-db-client-dev)
  13. ARG REPO_USER=callerai
  14. ARG REPO_PASS
  15. # Pinned deliberately. Unpinned, the apt layer caches and a newer client in the
  16. # repository changes nothing at all - the image kept installing 2.11.3 for a
  17. # month after 2.12.0 was published, and nothing said so. Pinning makes the
  18. # version a declared fact, busts the layer when it is bumped, and turns a
  19. # missing version into a build failure instead of a silently old client.
  20. #
  21. # Keep this at the version the daemon runs. The client is backward compatible,
  22. # so a newer daemon with an older client works - it just cannot use anything
  23. # the newer one added.
  24. #
  25. # Two ERROR-SHAPE changes live under this unchanged soname, so a symbol or ABI
  26. # check reports "no consumer impact" and is wrong both times:
  27. #
  28. # 2.12.4 - a read whose "nothing there" value is also a valid answer now throws
  29. # Client::Error on a failed status instead of answering empty. Every read in
  30. # lib/storage/storage_client.cpp catches it.
  31. # 2.13.1 - DeadlineExceeded on a WRITE no longer means the write failed; it
  32. # carries reason "outcome_unknown", because the deadline can expire while the
  33. # server finishes it. We map that to ErrorCode::WriteOutcomeUnknown and
  34. # answer 504 WITHOUT inviting a retry, since repeating such a write can apply
  35. # it twice. Lowering the pin silently restores "please retry" on those.
  36. #
  37. # tests/cpp/storage_read_failures_test.cpp is written against both contracts and
  38. # fails on anything older, so do not lower this without reading it.
  39. ARG DB_CLIENT_VERSION=2.13.1-1
  40. COPY packaging/smartbotics-repo.gpg /usr/share/keyrings/smartbotics-repo.gpg
  41. RUN echo "deb [signed-by=/usr/share/keyrings/smartbotics-repo.gpg] https://repository.smartbotics.ai trixie main" \
  42. > /etc/apt/sources.list.d/smartbotics.list \
  43. && printf "machine repository.smartbotics.ai\nlogin %s\npassword %s\n" \
  44. "$REPO_USER" "$REPO_PASS" > /etc/apt/auth.conf.d/smartbotics.conf \
  45. && chmod 600 /etc/apt/auth.conf.d/smartbotics.conf \
  46. && apt-get update \
  47. && apt-get install -y --no-install-recommends \
  48. libsmartbotic-db-client-dev=${DB_CLIENT_VERSION} \
  49. libsmartbotic-db-client=${DB_CLIENT_VERSION} \
  50. && rm -rf /var/lib/apt/lists/* \
  51. && rm -f /etc/apt/auth.conf.d/smartbotics.conf \
  52. && rm -f /etc/apt/sources.list.d/smartbotics.list
  53. RUN apt-get update && apt-get install -y --no-install-recommends \
  54. # Build tools
  55. build-essential cmake ninja-build git pkg-config ccache dpkg-dev \
  56. # Compression / crypto / uuid
  57. libssl-dev zlib1g-dev libbrotli-dev uuid-dev \
  58. # gRPC + protobuf
  59. protobuf-compiler libprotobuf-dev libgrpc++-dev protobuf-compiler-grpc \
  60. # JSON + logging + fmt
  61. nlohmann-json3-dev libspdlog-dev libfmt-dev \
  62. # curl / websockets
  63. libcurl4-openssl-dev libwebsockets-dev \
  64. # MySQL/MariaDB + PostgreSQL clients. Without these the build still
  65. # succeeds and simply omits the mysql-query and postgresql-query nodes,
  66. # announced in one STATUS line - so a runner from this image registers a
  67. # node list quietly missing them, and a workflow using either fails with
  68. # an unknown node type only on hosts built this way.
  69. libmariadb-dev libpq-dev \
  70. # Image processing: Magick++ is the image node's engine, libexif reads EXIF.
  71. libmagick++-dev libexif-dev \
  72. # WebUI build (Node.js + npm)
  73. nodejs npm \
  74. && rm -rf /var/lib/apt/lists/* \
  75. && echo "smartbotic-automation:debian13:$(date -u +%Y-%m-%dT%H:%M:%SZ)" > /etc/smartbotic-automation-build-base