Dockerfile 1.5 KB

1234567891011121314151617181920212223242526272829303132
  1. # The database exactly as it runs on the host today.
  2. #
  3. # Not built from the .deb in the package repo: that one is a later build linked
  4. # against Abseil 20240722, while the host's binary - the one whose data this is
  5. # and whose behaviour is known - links 20260107. Installing the .deb produced a
  6. # container that could not start at all. The host's own files are copied in
  7. # instead, onto the same Ubuntu release the host runs, so the libraries match.
  8. FROM ubuntu:26.04
  9. # Runtime dependencies, from the package list the .deb declares plus what the
  10. # client library pulls in.
  11. RUN apt-get update \
  12. && apt-get install -y --no-install-recommends \
  13. libssl3t64 liblz4-1 libsystemd0 libjemalloc2 libyyjson0 liblmdb0 \
  14. libprotobuf32t64 libgrpc++1.51t64 libspdlog1.15 libfmt10 ca-certificates \
  15. && rm -rf /var/lib/apt/lists/*
  16. COPY hostbin/smartbotic-database /usr/bin/smartbotic-database
  17. COPY hostbin/libsmartbotic-db-client.so* /usr/lib/x86_64-linux-gnu/
  18. RUN ldconfig && ldd /usr/bin/smartbotic-database | grep -q "not found" && exit 1 || true
  19. # Matching the host unit, which sets these to stop the allocator holding on to
  20. # freed memory - the reason this is being moved off that machine at all.
  21. ENV MALLOC_ARENA_MAX=2
  22. ENV MALLOC_CONF=background_thread:true,dirty_decay_ms:1000,muzzy_decay_ms:1000
  23. # The encryption key lives inside the data directory, so the data and the key
  24. # that reads it are never separated.
  25. VOLUME ["/var/lib/smartbotic-database"]
  26. EXPOSE 9004
  27. ENTRYPOINT ["/usr/bin/smartbotic-database", "--config", "/etc/smartbotic-database/config.json"]