Dockerfile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # sm121 HA add-on image — THIN: bakes in the Rust toolchain; the
  2. # entrypoint compiles sm121 from the launcher repo on first boot (cached
  3. # in the add-on's data folder). The Pi IS the build host: always the right
  4. # arch, the binary never goes stale, and the image carries no sm121
  5. # binary at all (specs/tech-architecture/ha-addon-recipe-repos.md —
  6. # "build on ha.lan" variant for HAOS, which has no Docker).
  7. #
  8. # make addon-image # context = docker-images/sm121-addon/
  9. # scripts/smoke-addon.sh
  10. #
  11. # The image is arch-generic EXCEPT the baked rustup toolchain (built for
  12. # the build host's arch — build it on an aarch64 host for the Pi; a
  13. # multi-arch buildx push covers x86_64 HA hosts too).
  14. FROM debian:bookworm-slim
  15. # git (launcher-repo fetch + recipe-repo sync) + jq (env → config) +
  16. # ca-certs (https) + gcc/libc6-dev (ring's C backend, via russh)
  17. RUN apt-get update \
  18. && apt-get install -y --no-install-recommends \
  19. git ca-certificates jq curl gcc libc6-dev \
  20. && rm -rf /var/lib/apt/lists/*
  21. # Rust toolchain, pinned (edition 2024 + let-chains need rust ≥ 1.88; the
  22. # launcher's Cargo.toml pins the exact version). `minimal` profile — no
  23. # docs/rustfmt/clippy (the Pi only builds, never lints).
  24. ENV RUSTUP_HOME=/usr/local/rustup \
  25. CARGO_HOME=/usr/local/cargo \
  26. PATH=/usr/local/cargo/bin:$PATH
  27. RUN curl -sSf https://sh.rustup.rs \
  28. | sh -s -- -y --profile minimal --default-toolchain 1.98.1 \
  29. && rustup toolchain list
  30. COPY entrypoint.sh /entrypoint.sh
  31. RUN chmod 755 /entrypoint.sh
  32. ENV SM121_WEB_PORT=3100
  33. EXPOSE 3100
  34. ENTRYPOINT ["/entrypoint.sh"]