ARG BUILD_FROM=ghcr.io/hassio-addons/debian-base/amd64:4.2.2 # hadolint ignore=DL3006 FROM ${BUILD_FROM} # Set shell SHELL ["/bin/bash", "-o", "pipefail", "-c"] # Copy Python requirements file COPY requirements.txt /tmp/ # Setup base RUN \ apt-get update \ \ && apt-get install -y --no-install-recommends \ dirmngr \ gpg-agent \ gpg \ nginx \ git \ \ && curl -L https://apt.mopidy.com/mopidy.gpg | apt-key add - \ && curl -L https://apt.mopidy.com/mopidy.list -o /etc/apt/sources.list.d/mopidy.list \ \ && apt-get update \ \ && apt-get install -y --no-install-recommends \ libffi-dev \ libxml2-dev \ libxslt1-dev \ libasound2-dev \ libspotify12 \ libspotify-dev \ zlib1g-dev \ build-essential \ python3-dev \ python3-gi \ python3-gst-1.0 \ gstreamer1.0-alsa \ gstreamer1.0-plugins-bad \ gstreamer1.0-plugins-good \ gstreamer1.0-plugins-ugly \ gstreamer1.0-pulseaudio \ \ && curl https://bootstrap.pypa.io/get-pip.py | python3 \ && pip3 install --no-cache-dir -r /tmp/requirements.txt \ \ && find /usr/local/lib/python3.7/ -type d -name tests -depth -exec rm -rf {} \; \ && find /usr/local/lib/python3.7/ -type d -name test -depth -exec rm -rf {} \; \ && find /usr/local/lib/python3.7/ -name __pycache__ -depth -exec rm -rf {} \; \ && find /usr/local/lib/python3.7/ -name "*.pyc" -depth -exec rm -f {} \; \ \ && apt-get purge -y --auto-remove \ dirmngr \ gpg-agent \ gpg \ git \ libffi-dev \ libxml2-dev \ libxslt1-dev \ zlib1g-dev \ build-essential \ gcc \ python-dev \ dpkg-dev \ gcc-7 \ && rm -fr \ /var/{cache,log}/* \ /var/lib/apt/lists/* \ /root/.cache \ && find /tmp/ -mindepth 1 -delete # Move access.log to stdout and error.log to stderr RUN mkdir -p /var/log/nginx && ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log # Copy root filesystem COPY rootfs / # Build arguments ARG BUILD_ARCH ARG BUILD_DATE ARG BUILD_DESCRIPTION ARG BUILD_NAME ARG BUILD_REF ARG BUILD_REPOSITORY ARG BUILD_VERSION # Labels LABEL \ io.hass.name="${BUILD_NAME}" \ io.hass.description="${BUILD_DESCRIPTION}" \ io.hass.arch="${BUILD_ARCH}" \ io.hass.type="addon" \ io.hass.version=${BUILD_VERSION} \ maintainer="Bram Mittendorff, Franck Nijhof, Robbert Müller" \ org.opencontainers.image.title="${BUILD_NAME}" \ org.opencontainers.image.description="${BUILD_DESCRIPTION}" \ org.opencontainers.image.vendor="Home Assistant Community Add-ons" \ org.opencontainers.image.authors="Bram Mittendorff, Franck Nijhof, Robbert Müller" \ org.opencontainers.image.licenses="MIT" \ org.opencontainers.image.url="https://addons.community" \ org.opencontainers.image.source="https://github.com/${BUILD_REPOSITORY}" \ org.opencontainers.image.documentation="https://github.com/${BUILD_REPOSITORY}/blob/main/README.md" \ org.opencontainers.image.created=${BUILD_DATE} \ org.opencontainers.image.revision=${BUILD_REF} \ org.opencontainers.image.version=${BUILD_VERSION}