Dockerfile 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. FROM alpine:3.11 as download
  2. RUN apk add --no-cache git
  3. USER nobody
  4. # 0.2.200
  5. ARG MONITOR_VERSION=1deec402b9b6323a964381819b199300259bb584
  6. RUN git clone https://github.com/andrewjfreyer/monitor /tmp/monitor \
  7. && git -C /tmp/monitor checkout $MONITOR_VERSION
  8. # workaround for broken multi-stage copy
  9. # > failed to copy files: failed to copy directory: Error processing tar file(exit status 1): Container ID ... cannot be mapped to a host ID
  10. USER 0
  11. RUN chown -R 0:0 /tmp/monitor \
  12. && chmod a+rX -R -c /tmp/monitor
  13. FROM alpine:3.11
  14. RUN apk add --no-cache \
  15. bash \
  16. bluez-btmon \
  17. bluez-deprecated `# hcidump` \
  18. mosquitto-clients \
  19. tini \
  20. && find / -xdev -type f -perm /u+s -exec chmod -c u-s {} \; \
  21. && find / -xdev -type f -perm /g+s -exec chmod -c g-s {} \; \
  22. && mkdir /monitor-config \
  23. && chmod a+rwxt /monitor-config `# .public_name_cache`
  24. ENTRYPOINT ["/sbin/tini", "--"]
  25. VOLUME /monitor-config
  26. COPY --from=download /tmp/monitor /monitor
  27. RUN chmod a+rwxt /monitor `# mkfifo main_pipe|log_pipe|packet_pipe`
  28. # still using rwxt on $CONFIG_DIR_PATH to support arbitrary uids
  29. USER nobody
  30. # > line 1986: main_pipe: No such file or directory
  31. WORKDIR /monitor
  32. CMD ["bash", "monitor.sh", "-D", "/monitor-config"]