Dockerfile 1.3 KB

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