Dockerfile 1.8 KB

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