Dockerfile 851 B

1234567891011121314151617181920212223242526
  1. ARG HOME_ASSISTANT_VERSION=0.104.3
  2. FROM homeassistant/home-assistant:$HOME_ASSISTANT_VERSION
  3. # Adafruit-DHT: no wheel available
  4. # https://pypi.org/project/Adafruit-DHT/1.4.0/#files
  5. # https://wheels.home-assistant.io/alpine-3.10/armv7/
  6. RUN apk add --no-cache \
  7. gcc \
  8. musl-dev
  9. # inherited:
  10. # CMD ["python3", "-m", "homeassistant", "--config", "/config"]
  11. # not inherited:
  12. EXPOSE 8123/tcp
  13. # why do the home assistant maintainers run their containers as root?!
  14. RUN python3 -c 'import os; assert os.geteuid() == 0, "finally..."' \
  15. && find / -xdev -type f -perm /u+s -exec chmod -c u-s {} \; \
  16. && find / -xdev -type f -perm /g+s -exec chmod -c g-s {} \; \
  17. && adduser -D hass \
  18. && chown hass /config \
  19. && mkdir -p ~hass/.config/pip \
  20. && echo -e '[install]\nuser = yes' > ~hass/.config/pip/pip.conf
  21. VOLUME /config
  22. USER hass