Dockerfile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # with `FROM docker.io/alpine:3.16.1`:
  2. # > $ apk add --no-cache \
  3. # > --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \
  4. # > dma=0.13-r3
  5. # > [...]
  6. # > ERROR: unable to select packages:
  7. # > so:libcrypto.so.3 (no such package):
  8. # > required by: dma-0.13-r3[so:libcrypto.so.3]
  9. # > so:libssl.so.3 (no such package):
  10. # > required by: dma-0.13-r3[so:libssl.so.3]
  11. FROM docker.io/alpine:20240606
  12. # https://git.alpinelinux.org/aports/log/community/dumb-init
  13. ARG DUMB_INIT_PACKAGE_VERSION=1.2.5-r3
  14. # https://github.com/openbsd/src/commits/master/usr.bin/nc
  15. # https://git.alpinelinux.org/aports/log/main/netcat-openbsd
  16. ARG NETCAT_PACKAGE_VERSION=1.226-r0
  17. # https://git.alpinelinux.org/aports/log/community/dma
  18. ARG DMA_PACKAGE_VERSION=0.13-r4
  19. RUN apk add --no-cache \
  20. dma=${DMA_PACKAGE_VERSION} \
  21. dumb-init=${DUMB_INIT_PACKAGE_VERSION} \
  22. netcat-openbsd=${NETCAT_PACKAGE_VERSION} \
  23. && adduser -S -G mail report
  24. VOLUME /var/spool/dma
  25. ENV TOR_HOST= \
  26. TOR_PORT=9050 \
  27. ONION_SERVICE_HOST= \
  28. ONION_SERVICE_PORT= \
  29. TIMEOUT_SECONDS=4 \
  30. SLEEP_DURATION=16s \
  31. RETRIES=0 \
  32. MAIL_TO= \
  33. VERBOSE=
  34. COPY --chown=report:nobody monitor.sh /
  35. USER report
  36. ENTRYPOINT ["dumb-init", "--"]
  37. CMD ["/monitor.sh"]
  38. HEALTHCHECK CMD nc -z "$TOR_HOST" "$TOR_PORT" || exit 1
  39. # https://github.com/opencontainers/image-spec/blob/v1.0.1/annotations.md
  40. ARG REVISION=
  41. LABEL org.opencontainers.image.title="report online status of tor onion services via email" \
  42. org.opencontainers.image.source="https://github.com/fphammerle/onion-service-status-mail" \
  43. org.opencontainers.image.revision="$REVISION"