Dockerfile 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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:20240807
  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://salsa.debian.org/debian/netcat-openbsd/-/commits/debian/latest
  16. # https://git.alpinelinux.org/aports/log/main/netcat-openbsd
  17. ARG NETCAT_PACKAGE_VERSION=1.226.1.1-r0
  18. # https://git.alpinelinux.org/aports/log/community/dma
  19. ARG DMA_PACKAGE_VERSION=0.13-r4
  20. RUN apk add --no-cache \
  21. dma=${DMA_PACKAGE_VERSION} \
  22. dumb-init=${DUMB_INIT_PACKAGE_VERSION} \
  23. netcat-openbsd=${NETCAT_PACKAGE_VERSION} \
  24. && adduser -S -G mail report
  25. VOLUME /var/spool/dma
  26. ENV TOR_HOST= \
  27. TOR_PORT=9050 \
  28. ONION_SERVICE_HOST= \
  29. ONION_SERVICE_PORT= \
  30. TIMEOUT_SECONDS=4 \
  31. SLEEP_DURATION=16s \
  32. RETRIES=0 \
  33. MAIL_TO= \
  34. VERBOSE=
  35. COPY --chown=report:nobody monitor.sh /
  36. USER report
  37. ENTRYPOINT ["dumb-init", "--"]
  38. CMD ["/monitor.sh"]
  39. HEALTHCHECK CMD nc -z "$TOR_HOST" "$TOR_PORT" || exit 1
  40. # https://github.com/opencontainers/image-spec/blob/v1.0.1/annotations.md
  41. ARG REVISION=
  42. LABEL org.opencontainers.image.title="report online status of tor onion services via email" \
  43. org.opencontainers.image.source="https://github.com/fphammerle/onion-service-status-mail" \
  44. org.opencontainers.image.revision="$REVISION"