Skip to content

Instantly share code, notes, and snippets.

@Ulrar
Created June 2, 2020 22:02
Show Gist options
  • Save Ulrar/60f29c58f3f5cad0758a6728c394e675 to your computer and use it in GitHub Desktop.
Save Ulrar/60f29c58f3f5cad0758a6728c394e675 to your computer and use it in GitHub Desktop.
Dockerfile forked-daapd-hassio
ARG BUILD_FROM=hassioaddons/debian-base:3.0.0
# hadolint ignore=DL3006
FROM ${BUILD_FROM}
RUN sed -i 's/main/main contrib non-free/g' /etc/apt/sources.list
RUN apt-get update -y
RUN apt-get install -y --no-install-recommends curl gpg gpg-agent dirmngr apt-transport-https
RUN curl -L https://apt.mopidy.com/mopidy.list -o /etc/apt/sources.list.d/mopidy.list
RUN curl -L https://apt.mopidy.com/mopidy.gpg -o /tmp/mopidy.gpg
RUN apt-key add /tmp/mopidy.gpg
RUN apt-get update -y
RUN mkdir -p /usr/share/man/man1
RUN apt-get install -y --no-install-recommends libcurl4-gnutls-dev
RUN apt-get install -y --no-install-recommends openjdk-11-jre-headless
RUN apt-get install -y --no-install-recommends build-essential
RUN apt-get install -y --no-install-recommends avahi-daemon
RUN apt-get install -y --no-install-recommends libgnutls28-dev
RUN apt-get install -y --no-install-recommends libprotobuf-c-dev
RUN apt-get install -y --no-install-recommends libplist-dev
RUN apt-get install -y --no-install-recommends libsodium-dev
RUN apt-get install -y --no-install-recommends libwebsockets-dev
RUN apt-get install -y --no-install-recommends pulseaudio
RUN apt-get install -y --no-install-recommends libpulse-dev
RUN apt-get install -y --no-install-recommends git
RUN apt-get install -y --no-install-recommends autotools-dev
RUN apt-get install -y --no-install-recommends autoconf
RUN apt-get install -y --no-install-recommends automake
RUN apt-get install -y --no-install-recommends libtool
RUN apt-get install -y --no-install-recommends gettext
RUN apt-get install -y --no-install-recommends gawk
RUN apt-get install -y --no-install-recommends gperf
RUN apt-get install -y --no-install-recommends libantlr3c-dev
RUN apt-get install -y --no-install-recommends libconfuse-dev
RUN apt-get install -y --no-install-recommends libunistring-dev
RUN apt-get install -y --no-install-recommends libsqlite3-dev
RUN apt-get install -y --no-install-recommends libavcodec-dev
RUN apt-get install -y --no-install-recommends libavformat-dev
RUN apt-get install -y --no-install-recommends libavfilter-dev
RUN apt-get install -y --no-install-recommends libswscale-dev
RUN apt-get install -y --no-install-recommends libavutil-dev
RUN apt-get install -y --no-install-recommends libasound2-dev
RUN apt-get install -y --no-install-recommends libmxml-dev
RUN apt-get install -y --no-install-recommends libgcrypt20-dev
RUN apt-get install -y --no-install-recommends libavahi-client-dev
RUN apt-get install -y --no-install-recommends zlib1g-dev
RUN apt-get install -y --no-install-recommends libevent-dev
RUN apt-get install -y --no-install-recommends libplist-dev
RUN apt-get install -y --no-install-recommends libjson-c-dev
RUN apt-get install -y --no-install-recommends libspotify12
RUN apt-get install -y --no-install-recommends libspotify-dev
RUN curl -L -o /tmp/antlr-3.4-complete.jar http://www.antlr3.org/download/antlr-3.4-complete.jar && \
echo '#!/bin/bash' > /usr/local/bin/antlr3 && \
echo 'exec java -cp /tmp/antlr-3.4-complete.jar org.antlr.Tool "$@"' >> /usr/local/bin/antlr3 && \
chmod 775 /usr/local/bin/antlr3
RUN cd /tmp && \
git clone https://github.com/ejurgensen/forked-daapd.git && \
cd /tmp/forked-daapd && \
autoreconf -fi && \
./configure \
--enable-itunes \
--enable-chromecast \
--with-pulseaudio \
--enable-spotify \
--with-libwebsockets && \
make && \
make install
RUN cd /usr/local/etc \
&& sed -i -e 's/\(uid.*=.*\)/uid = "root"/g' forked-daapd.conf \
&& sed -i s#"ipv6 = yes"#"ipv6 = no"#g forked-daapd.conf \
&& sed -i s#/srv/music#/share/forked-daapd/music#g forked-daapd.conf \
&& sed -i s#/usr/local/var/cache/forked-daapd/songs3.db#/share/forked-daapd/cache/songs3.db#g forked-daapd.conf \
&& sed -i s#/usr/local/var/cache/forked-daapd/cache.db#/share/forked-daapd/cache/cache.db#g forked-daapd.conf \
&& sed -i s#/usr/local/var/log/forked-daapd.log#/dev/stdout#g forked-daapd.conf \
&& sed -i "/websocket_port\ =/ s/# *//" forked-daapd.conf \
&& sed -i "/trusted_networks\ =/ s/# *//" forked-daapd.conf \
&& sed -i "/pipe_autostart\ =/ s/# *//" forked-daapd.conf \
&& sed -i "/db_path\ =/ s/# *//" forked-daapd.conf \
&& sed -i "/cache_path\ =/ s/# *//" forked-daapd.conf
# Copy root filesystem
COPY rootfs /
# Build arguments
ARG BUILD_ARCH
ARG BUILD_DATE
ARG BUILD_REF
ARG BUILD_VERSION
# Labels
LABEL \
io.hass.name="Forked-daapd Server" \
io.hass.description="The forked-daapd server program" \
io.hass.arch="${BUILD_ARCH}" \
io.hass.type="addon" \
io.hass.version=${BUILD_VERSION} \
maintainer="" \
org.label-schema.description="The forked-daapd server program" \
org.label-schema.build-date=${BUILD_DATE} \
org.label-schema.name="Forked-daapd Server" \
org.label-schema.schema-version="1.0" \
org.label-schema.url="" \
org.label-schema.usage="" \
org.label-schema.vcs-ref=${BUILD_REF} \
org.label-schema.vcs-url="" \
org.label-schema.vendor=""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment