Dockerfile 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # https://github.com/home-assistant/core/blob/0.107.0/azure-pipelines-release.yml#L76
  2. ARG HOME_ASSISTANT_VERSION=0.107.0
  3. FROM homeassistant/home-assistant:$HOME_ASSISTANT_VERSION
  4. # Adafruit-DHT: no wheel available
  5. # https://pypi.org/project/Adafruit-DHT/1.4.0/#files
  6. # https://wheels.home-assistant.io/alpine-3.10/armv7/
  7. #> $ sudo docker run --rm homeassistant/home-assistant:0.104.3 pip freeze | grep -i adafruit
  8. #> starting version 3.2.8
  9. #> Adafruit-Blinka==1.2.1
  10. #> adafruit-circuitpython-busdevice==4.1.1
  11. #> adafruit-circuitpython-mcp230xx==1.1.2
  12. #> Adafruit-GPIO==1.0.3
  13. #> Adafruit-PCA9685==1.0.1
  14. #> Adafruit-PlatformDetect==1.4.5
  15. #> Adafruit-PureIO==1.0.4
  16. #> Adafruit-SHT31==1.0.2
  17. # but no 'Adafruit-DHT'
  18. RUN apk add --no-cache \
  19. gcc \
  20. musl-dev \
  21. tini
  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
  34. # > $ docker inspect --format '{{json .Config.Entrypoint}}' homeassistant/home-assistant:0.106.6
  35. # > ["/bin/entry.sh"]
  36. # > $ dockerinspect --format '{{json .Config.Cmd}}' homeassistant/home-assistant:0.106.6
  37. # > ["python3","-m","homeassistant","--config","/config"]
  38. # > $ dockerinspect --format '{{json .Config.Entrypoint}}' homeassistant/home-assistant:0.107.0
  39. # > ["/init"]
  40. # > $ dockerinspect --format '{{json .Config.Cmd}}' homeassistant/home-assistant:0.107.0
  41. # > null
  42. # see https://github.com/home-assistant/docker-base/pull/62
  43. # > For now, `s6-overlay` doesn't support running it with a user different than `root`, so consequently Dockerfile `USER` directive is not supported (except `USER root` of course ;P).
  44. # src: https://github.com/just-containers/s6-overlay/blame/v1.22.1.0/README.md#L420
  45. # workaround: disable useless (but annoying) s6-overlay
  46. ENTRYPOINT ["tini", "--"]
  47. # default in home-assistant<0.107.0
  48. CMD ["python3", "-m", "homeassistant", "--config", "/config"]