FROM alpine:latest AS builder LABEL maintainer="Thomas Dalton " LABEL org.opencontainers.image.source="https://git.tabbytv.com/tom/docker-mpd" ARG MPD_VERSION="v0.23.16" ARG TWOLAME_VERSION="0.4.0" RUN set -xe \ && apk add --no-cache alpine-sdk cmake alsa-lib-dev avahi-dev boost-dev curl-dev expat-dev faad2-dev ffmpeg-dev flac-dev fmt-dev glib-dev gtest-dev icu-dev jack-dev lame-dev libao-dev libcap-utils libcdio-paranoia-dev libid3tag-dev libmad-dev libmodplug-dev libmpdclient-dev libogg-dev libsamplerate-dev libshout-dev libvorbis-dev meson opus-dev pipewire-dev pulseaudio-dev py3-attrs py3-sphinx soxr-dev wavpack-dev ADD https://github.com/njh/twolame/releases/download/${TWOLAME_VERSION}/twolame-${TWOLAME_VERSION}.tar.gz /tmp/twolame.tar.gz RUN tar -xzf /tmp/twolame.tar.gz -C /tmp WORKDIR /tmp/twolame-${TWOLAME_VERSION} RUN ./configure --prefix=/tmp/build/twolame RUN make -j${nproc} RUN make install ADD https://github.com/MusicPlayerDaemon/MPD.git#${MPD_VERSION} /tmp/mpd WORKDIR /tmp/mpd RUN meson setup . output --buildtype=release -Db_lto=true -Dtwolame=enabled -Dsysconfdir='/usr/local/etc' RUN meson compile -C output RUN meson install -C output --destdir /tmp/build/mpd FROM alpine:latest COPY --from=builder /tmp/build/mpd /usr/local COPY --from=builder /tmp/mpd/doc/mpdconf.example /usr/local/etc/mpd.conf COPY --from=builder /tmp/build/twolame /usr/local RUN apk add --no-cache avahi-libs boost faad2-libs ffmpeg-libavformat ffmpeg-libavfilter fmt libao libcdio libcdio-paranoia libcurl libid3tag libmad libmodplug libmpdclient libpulse libsamplerate libshout pipewire-jack pipewire-libs wavpack-libs VOLUME ["/var/lib/mpd"] EXPOSE 6600 CMD ["mpd", "--stdout", "--no-daemon"]