Dockerfile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. curl `# support/data https://api.macvendors.com/` \
  22. gawk `# in verbose mode: %*x formats are not supported` \
  23. mosquitto-clients \
  24. tini \
  25. && find / -xdev -type f -perm /u+s -exec chmod -c u-s {} \; \
  26. && find / -xdev -type f -perm /g+s -exec chmod -c g-s {} \; \
  27. && mkdir /monitor-config \
  28. && chmod a+rwxt /monitor-config `# .public_name_cache`
  29. ENTRYPOINT ["/sbin/tini", "--"]
  30. VOLUME /monitor-config
  31. COPY --from=download /tmp/monitor /monitor
  32. RUN chmod a+rwxt /monitor `# mkfifo main_pipe|log_pipe|packet_pipe`
  33. # still using rwxt on $CONFIG_DIR_PATH to support arbitrary uids
  34. USER nobody
  35. # > line 1986: main_pipe: No such file or directory
  36. WORKDIR /monitor
  37. CMD ["bash", "monitor.sh", "-D", "/monitor-config", "-V"]