Dockerfile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. #> $ sudo docker run --rm homeassistant/home-assistant:0.104.3 pip freeze | grep -i adafruit
  7. #> starting version 3.2.8
  8. #> Adafruit-Blinka==1.2.1
  9. #> adafruit-circuitpython-busdevice==4.1.1
  10. #> adafruit-circuitpython-mcp230xx==1.1.2
  11. #> Adafruit-GPIO==1.0.3
  12. #> Adafruit-PCA9685==1.0.1
  13. #> Adafruit-PlatformDetect==1.4.5
  14. #> Adafruit-PureIO==1.0.4
  15. #> Adafruit-SHT31==1.0.2
  16. # but no 'Adafruit-DHT'
  17. RUN apk add --no-cache \
  18. gcc \
  19. musl-dev
  20. # inherited:
  21. # CMD ["python3", "-m", "homeassistant", "--config", "/config"]
  22. # not inherited:
  23. EXPOSE 8123/tcp
  24. # why do the home assistant maintainers run their containers as root?!
  25. RUN python3 -c 'import os; assert os.geteuid() == 0, "finally..."' \
  26. && find / -xdev -type f -perm /u+s -exec chmod -c u-s {} \; \
  27. && find / -xdev -type f -perm /g+s -exec chmod -c g-s {} \; \
  28. && adduser -D hass \
  29. && chown hass /config \
  30. && mkdir -p ~hass/.config/pip \
  31. && echo -e '[install]\nuser = yes' > ~hass/.config/pip/pip.conf
  32. VOLUME /config
  33. USER hass