mirror of
https://github.com/linuxserver/docker-daapd.git
synced 2026-02-06 03:19:04 +08:00
145 lines
4.2 KiB
Docker
145 lines
4.2 KiB
Docker
FROM ghcr.io/linuxserver/baseimage-alpine:3.17 as buildstage
|
|
############## build stage ##############
|
|
|
|
ARG DAAPD_RELEASE
|
|
ARG LIBSPOTIFY_VERSION=12.1.51
|
|
ARG ARCH=x86_64
|
|
|
|
RUN \
|
|
echo "**** install build packages ****" && \
|
|
apk add -U --update --no-cache \
|
|
alsa-lib-dev \
|
|
autoconf \
|
|
automake \
|
|
avahi-dev \
|
|
bison \
|
|
bsd-compat-headers \
|
|
confuse-dev \
|
|
curl-dev \
|
|
ffmpeg-dev \
|
|
file \
|
|
flac-dev \
|
|
flex \
|
|
g++ \
|
|
gcc \
|
|
gettext-dev \
|
|
gnutls-dev \
|
|
gperf \
|
|
json-c-dev \
|
|
libevent-dev \
|
|
libgcrypt-dev \
|
|
libogg-dev \
|
|
libplist-dev \
|
|
openssl-dev \
|
|
libsodium-dev \
|
|
libtool \
|
|
libunistring-dev \
|
|
libwebsockets-dev \
|
|
make \
|
|
mxml-dev \
|
|
openjdk8-jre-base \
|
|
protobuf-c-dev \
|
|
sqlite-dev \
|
|
taglib-dev && \
|
|
echo "**** make antlr wrapper ****" && \
|
|
mkdir -p \
|
|
/tmp/source/owntone && \
|
|
echo \
|
|
"#!/bin/bash" > /tmp/source/antlr3 && \
|
|
echo \
|
|
"exec java -cp /tmp/source/antlr-3.4-complete.jar org.antlr.Tool \"\$@\"" >> /tmp/source/antlr3 && \
|
|
chmod a+x /tmp/source/antlr3 && \
|
|
curl -o \
|
|
/tmp/source/antlr-3.4-complete.jar -L \
|
|
http://www.antlr3.org/download/antlr-3.4-complete.jar && \
|
|
echo "**** compile and install antlr3c ****" && \
|
|
curl -o \
|
|
/tmp/libantlr3c-3.4.tar.gz -L \
|
|
https://github.com/antlr/website-antlr3/raw/gh-pages/download/C/libantlr3c-3.4.tar.gz && \
|
|
tar xf /tmp/libantlr3c-3.4.tar.gz -C /tmp && \
|
|
cd /tmp/libantlr3c-3.4 && \
|
|
./configure --enable-64bit --prefix=/usr && \
|
|
make && \
|
|
make DESTDIR=/tmp/antlr3c-build install && \
|
|
export LDFLAGS="-L/tmp/antlr3c-build/usr/lib" && \
|
|
export CFLAGS="-I/tmp/antlr3c-build/usr/include" && \
|
|
echo "**** compile owntone-server ****" && \
|
|
if [ -z ${DAAPD_RELEASE+x} ]; then \
|
|
DAAPD_RELEASE=$(curl -sX GET "https://api.github.com/repos/owntone/owntone-server/releases/latest" \
|
|
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
|
|
fi && \
|
|
curl -L https://github.com/mopidy/libspotify-archive/blob/master/libspotify-${LIBSPOTIFY_VERSION}-Linux-${ARCH}-release.tar.gz?raw=true | tar -xzf- -C /tmp/source/ && \
|
|
mv /tmp/source/libspotify* /tmp/source/libspotify && \
|
|
sed -i 's/ldconfig//' /tmp/source/libspotify/Makefile && \
|
|
make -C /tmp/source/libspotify prefix=/tmp/libspotify-build install && \
|
|
rm -rf /tmp/source/libspotify && \
|
|
export LIBSPOTIFY_CFLAGS="-I/tmp/libspotify-build/include" && \
|
|
export LIBSPOTIFY_LIBS="/tmp/libspotify-build/lib/libspotify.so" && \
|
|
curl -o \
|
|
/tmp/source/owntone.tar.gz -L \
|
|
"https://github.com/owntone/owntone-server/archive/${DAAPD_RELEASE}.tar.gz" && \
|
|
tar xf /tmp/source/owntone.tar.gz -C \
|
|
/tmp/source/owntone --strip-components=1 && \
|
|
export PATH="/tmp/source:$PATH" && \
|
|
cd /tmp/source/owntone && \
|
|
autoreconf -i -v && \
|
|
./configure \
|
|
--build=$CBUILD \
|
|
--enable-chromecast \
|
|
--enable-itunes \
|
|
--enable-lastfm \
|
|
--enable-mpd \
|
|
--enable-spotify \
|
|
--host=$CHOST \
|
|
--infodir=/usr/share/info \
|
|
--localstatedir=/var \
|
|
--mandir=/usr/share/man \
|
|
--prefix=/usr \
|
|
--sysconfdir=/etc && \
|
|
make && \
|
|
make DESTDIR=/tmp/daapd-build install && \
|
|
mv /tmp/daapd-build/etc/owntone.conf /tmp/daapd-build/etc/owntone.conf.orig && \
|
|
rm -rf /tmp/daapd-build/var
|
|
############## runtime stage ##############
|
|
FROM ghcr.io/linuxserver/baseimage-alpine:3.17
|
|
|
|
# set version label
|
|
ARG BUILD_DATE
|
|
ARG VERSION
|
|
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
|
LABEL maintainer="BernsteinA"
|
|
|
|
RUN \
|
|
echo "**** install runtime packages ****" && \
|
|
apk add -U --update --no-cache \
|
|
avahi \
|
|
confuse \
|
|
dbus \
|
|
ffmpeg \
|
|
json-c \
|
|
libevent \
|
|
libgcrypt \
|
|
libplist \
|
|
libsodium \
|
|
libunistring \
|
|
libuuid \
|
|
libwebsockets \
|
|
mxml \
|
|
protobuf-c \
|
|
sqlite \
|
|
sqlite-libs && \
|
|
apk add -U --update --no-cache --repository https://dl-cdn.alpinelinux.org/alpine/edge/testing \
|
|
librespot && \
|
|
mkdir -p /music
|
|
|
|
# copy buildstage and local files
|
|
COPY --from=buildstage /tmp/daapd-build/ /
|
|
COPY --from=buildstage /tmp/antlr3c-build/ /
|
|
COPY --from=buildstage /tmp/libspotify-build/ /
|
|
COPY root/ /
|
|
|
|
# ports and volumes
|
|
EXPOSE 3689
|
|
|
|
VOLUME /config /music
|