Dockerfile 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  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. coreutils `# timeout busybox implementation incompatible` \
  19. mosquitto-clients \
  20. tini \
  21. && find / -xdev -type f -perm /u+s -exec chmod -c u-s {} \; \
  22. && find / -xdev -type f -perm /g+s -exec chmod -c g-s {} \; \
  23. && mkdir /monitor-config \
  24. && chmod a+rwxt /monitor-config `# .public_name_cache`
  25. ENTRYPOINT ["/sbin/tini", "--"]
  26. VOLUME /monitor-config
  27. COPY --from=download /tmp/monitor /monitor
  28. RUN chmod a+rwxt /monitor `# mkfifo main_pipe|log_pipe|packet_pipe`
  29. # still using rwxt on $CONFIG_DIR_PATH to support arbitrary uids
  30. USER nobody
  31. # > line 1986: main_pipe: No such file or directory
  32. WORKDIR /monitor
  33. CMD ["bash", "monitor.sh", "-D", "/monitor-config"]