Merge branch 'jojo141185-patch-2' into develop
This commit is contained in:
145
Dockerfile
145
Dockerfile
@ -1,8 +1,11 @@
|
|||||||
FROM rust:slim-bullseye
|
# --- Build Node ---
|
||||||
|
FROM rust:slim-bullseye AS Builder
|
||||||
LABEL org.opencontainers.image.authors="https://github.com/seppi91"
|
LABEL org.opencontainers.image.authors="https://github.com/seppi91"
|
||||||
ARG TARGETPLATFORM
|
ARG TARGETPLATFORM
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
ARG TARGETVARIANT
|
ARG TARGETVARIANT
|
||||||
|
|
||||||
|
# Print Info about current build Target
|
||||||
RUN printf "I'm building for TARGETPLATFORM=${TARGETPLATFORM}" \
|
RUN printf "I'm building for TARGETPLATFORM=${TARGETPLATFORM}" \
|
||||||
&& printf ", TARGETARCH=${TARGETARCH}" \
|
&& printf ", TARGETARCH=${TARGETARCH}" \
|
||||||
&& printf ", TARGETVARIANT=${TARGETVARIANT} \n" \
|
&& printf ", TARGETVARIANT=${TARGETVARIANT} \n" \
|
||||||
@ -13,6 +16,52 @@ RUN printf "I'm building for TARGETPLATFORM=${TARGETPLATFORM}" \
|
|||||||
USER root
|
USER root
|
||||||
|
|
||||||
# Install all libraries and needs
|
# Install all libraries and needs
|
||||||
|
RUN apt update \
|
||||||
|
&& apt install -yq --no-install-recommends \
|
||||||
|
git \
|
||||||
|
patch \
|
||||||
|
libgstreamer-plugins-base1.0-dev \
|
||||||
|
libgstreamer1.0-dev \
|
||||||
|
libcsound64-dev \
|
||||||
|
libclang-11-dev \
|
||||||
|
libpango1.0-dev \
|
||||||
|
libdav1d-dev \
|
||||||
|
# libgtk-4-dev \ Only in bookworm
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
WORKDIR /usr/src/gst-plugins-rs
|
||||||
|
|
||||||
|
# Clone source of gst-plugins-rs to workdir
|
||||||
|
ARG GST_PLUGINS_RS_TAG=main
|
||||||
|
RUN git clone -c advice.detachedHead=false \
|
||||||
|
--single-branch --depth 1 \
|
||||||
|
--branch ${GST_PLUGINS_RS_TAG} \
|
||||||
|
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git ./
|
||||||
|
# EXPERIMENTAL: For gstreamer-spotify set upgraded version number of dependency librespot to 0.4.2
|
||||||
|
RUN sed -i 's/librespot = { version = "0.4", default-features = false }/librespot = { version = "0.4.2", default-features = false }/g' audio/spotify/Cargo.toml
|
||||||
|
|
||||||
|
# Build GStreamer plugins written in Rust (optional with --no-default-features)
|
||||||
|
ENV DEST_DIR /target/gst-plugins-rs
|
||||||
|
ENV CARGO_PROFILE_RELEASE_DEBUG false
|
||||||
|
RUN export CSOUND_LIB_DIR="/usr/lib/$(uname -m)-linux-gnu" \
|
||||||
|
&& export PLUGINS_DIR=$(pkg-config --variable=pluginsdir gstreamer-1.0) \
|
||||||
|
&& export SO_SUFFIX=so \
|
||||||
|
&& cargo build --release --no-default-features \
|
||||||
|
# List of packages to build
|
||||||
|
--package gst-plugin-spotify \
|
||||||
|
# Use install command to create directory (-d), copy and print filenames (-v), and set attributes/permissions (-m)
|
||||||
|
&& install -v -d ${DEST_DIR}/${PLUGINS_DIR} \
|
||||||
|
&& install -v -m 755 target/release/*.${SO_SUFFIX} ${DEST_DIR}/${PLUGINS_DIR}
|
||||||
|
|
||||||
|
|
||||||
|
# --- Release Node ---
|
||||||
|
FROM debian:bullseye-slim as Release
|
||||||
|
|
||||||
|
# Switch to the root user while we do our changes
|
||||||
|
USER root
|
||||||
|
WORKDIR /
|
||||||
|
|
||||||
|
# Install GStreamer and other required Debian packages
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends \
|
&& apt-get install -y --no-install-recommends \
|
||||||
sudo \
|
sudo \
|
||||||
@ -21,93 +70,54 @@ RUN apt-get update \
|
|||||||
git \
|
git \
|
||||||
wget \
|
wget \
|
||||||
gnupg2 \
|
gnupg2 \
|
||||||
tar \
|
|
||||||
dumb-init \
|
dumb-init \
|
||||||
graphviz-dev \
|
graphviz-dev \
|
||||||
pulseaudio \
|
pulseaudio \
|
||||||
libasound2-dev \
|
libasound2-dev \
|
||||||
libdbus-glib-1-dev \
|
libdbus-glib-1-dev \
|
||||||
libgirepository1.0-dev \
|
libgirepository1.0-dev \
|
||||||
# DLNA Server
|
|
||||||
dleyna-server \
|
|
||||||
# Install Python
|
# Install Python
|
||||||
python3-dev \
|
python3-dev \
|
||||||
python3-gst-1.0 \
|
python3-gst-1.0 \
|
||||||
python3-setuptools \
|
python3-setuptools \
|
||||||
python3-pip \
|
python3-pip \
|
||||||
python3-venv \
|
|
||||||
# GStreamer (Plugins)
|
# GStreamer (Plugins)
|
||||||
libgstreamer1.0-dev \
|
|
||||||
libgstreamer-plugins-base1.0-dev \
|
|
||||||
libgstreamer-plugins-bad1.0-dev \
|
|
||||||
libgstrtspserver-1.0-dev \
|
|
||||||
gstreamer1.0-plugins-base \
|
|
||||||
gstreamer1.0-plugins-good \
|
gstreamer1.0-plugins-good \
|
||||||
gstreamer1.0-plugins-bad \
|
gstreamer1.0-plugins-bad \
|
||||||
gstreamer1.0-plugins-ugly \
|
gstreamer1.0-plugins-ugly \
|
||||||
gstreamer1.0-libav \
|
gstreamer1.0-libav \
|
||||||
#gstreamer1.0-alsa \
|
|
||||||
gstreamer1.0-pulseaudio \
|
gstreamer1.0-pulseaudio \
|
||||||
# GStreamer build dependencies see
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
# https://github.com/Kynothon/gst-plugins-rs-docker/blob/master/XDockerfile
|
|
||||||
llvm-dev \
|
# Copy builded target data from Builder DEST_DIR to root
|
||||||
libclang-dev \
|
# Note: target directory tree links directly to $GST_PLUGIN_PATH
|
||||||
clang \
|
COPY --from=Builder /target/gst-plugins-rs/ /
|
||||||
gcc \
|
|
||||||
libssl-dev \
|
|
||||||
libcsound64-dev \
|
|
||||||
libpango1.0-dev \
|
|
||||||
libdav1d-dev \
|
|
||||||
libwebp-dev
|
|
||||||
# libgtk-4-dev # Only in bookworm
|
|
||||||
|
|
||||||
# Install Node, to build Iris JS application
|
# Install Node, to build Iris JS application
|
||||||
RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash - && \
|
RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash - && \
|
||||||
apt-get install -y nodejs
|
apt-get install -y nodejs
|
||||||
|
|
||||||
# Install gstreamer-spotify (EXPERIMENTAL)
|
# Install mopidy and (optional) DLNA-server dleyna from apt.mopidy.com
|
||||||
# Note: For spotify with upgraded version number of dependency librespot to 0.4.2
|
|
||||||
#RUN cargo install cargo-c
|
|
||||||
WORKDIR /build
|
|
||||||
RUN git clone --depth 1 --single-branch -b main https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
|
|
||||||
WORKDIR /build/gst-plugins-rs
|
|
||||||
RUN sed -i 's/librespot = { version = "0.4", default-features = false }/librespot = { version = "0.4.2", default-features = false }/g' audio/spotify/Cargo.toml
|
|
||||||
RUN MULTIARCHTUPLE=$(dpkg-architecture -qDEB_HOST_MULTIARCH) \
|
|
||||||
#&& cargo cbuild --no-default-features -p gst-plugin-spotify --prefix=/usr --libdir=/usr/lib/$MULTIARCHTUPLE/ -r \
|
|
||||||
#&& cargo cinstall -p gst-plugin-spotify --prefix=/usr --libdir=/usr/lib/$MULTIARCHTUPLE/
|
|
||||||
&& cargo build --no-default-features -p gst-plugin-spotify -r \
|
|
||||||
&& cp ./target/release/libgstspotify.so /usr/lib/$MULTIARCHTUPLE/gstreamer-1.0/
|
|
||||||
#&& ln -s /usr/lib/$MULTIARCHTUPLE/gstreamer-1.0/libgstspotify.so /usr/lib64/$MULTIARCHTUPLE/gstreamer-1.0/libgstspotify.so || true \
|
|
||||||
WORKDIR /build
|
|
||||||
RUN rm -rf gst-plugins-rs
|
|
||||||
WORKDIR /
|
|
||||||
|
|
||||||
# Install mopidy from apt.mopidy.com
|
|
||||||
# see https://docs.mopidy.com/en/latest/installation/debian/
|
# see https://docs.mopidy.com/en/latest/installation/debian/
|
||||||
RUN mkdir -p /usr/local/share/keyrings \
|
RUN mkdir -p /usr/local/share/keyrings \
|
||||||
&& wget -q -O /usr/local/share/keyrings/mopidy-archive-keyring.gpg https://apt.mopidy.com/mopidy.gpg \
|
&& wget -q -O /usr/local/share/keyrings/mopidy-archive-keyring.gpg https://apt.mopidy.com/mopidy.gpg \
|
||||||
&& wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/buster.list \
|
&& wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/buster.list \
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
&& apt-get install -y mopidy \
|
&& apt-get install -y \
|
||||||
|
mopidy \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Upgrade Python package manager pip
|
# Upgrade Python package manager pip
|
||||||
# https://pypi.org/project/pip/
|
# https://pypi.org/project/pip/
|
||||||
RUN python3 -m pip install --upgrade pip
|
RUN python3 -m pip install --upgrade pip
|
||||||
|
|
||||||
# Install PyGObject
|
# Clone Iris from the repository and install in development mode.
|
||||||
# https://pypi.org/project/PyGObject/
|
# This allows a binding at "/iris" to map to your local folder for development, rather than
|
||||||
RUN python3 -m pip install pygobject
|
# installing using pip.
|
||||||
|
|
||||||
# Install cffi from source
|
|
||||||
# Note: In some distributions libffi-devel is too old, hardcoded stuff
|
|
||||||
# https://pypi.org/project/cffi/
|
|
||||||
RUN python3 -m pip install cffi
|
|
||||||
|
|
||||||
# Install Iris
|
|
||||||
# Note: ADD helps prevent RUN caching issues. When HEAD changes in repo, our cache will be invalidated!
|
# Note: ADD helps prevent RUN caching issues. When HEAD changes in repo, our cache will be invalidated!
|
||||||
ADD https://api.github.com/repos/jaedb/Iris/git/refs/heads/master version.json
|
ADD https://api.github.com/repos/jaedb/Iris/git/refs/heads/master version.json
|
||||||
RUN git clone --depth 1 --single-branch -b master https://github.com/jaedb/Iris.git /iris \
|
ENV IRIS_VERSION=develop
|
||||||
|
RUN git clone --depth 1 --single-branch -b ${IRIS_VERSION} https://github.com/jaedb/Iris.git /iris \
|
||||||
&& cd /iris \
|
&& cd /iris \
|
||||||
&& npm install \
|
&& npm install \
|
||||||
&& npm run prod \
|
&& npm run prod \
|
||||||
@ -115,13 +125,11 @@ RUN git clone --depth 1 --single-branch -b master https://github.com/jaedb/Iris.
|
|||||||
&& mkdir -p /var/lib/mopidy/.config \
|
&& mkdir -p /var/lib/mopidy/.config \
|
||||||
&& ln -s /config /var/lib/mopidy/.config/mopidy \
|
&& ln -s /config /var/lib/mopidy/.config/mopidy \
|
||||||
# Allow mopidy user to run system commands (restart, local scan, etc)
|
# Allow mopidy user to run system commands (restart, local scan, etc)
|
||||||
&& echo "mopidy ALL=NOPASSWD: /iris/mopidy_iris/system.sh" >> /etc/sudoers
|
&& echo "mopidy ALL=NOPASSWD: /iris/mopidy_iris/system.sh" >> /etc/sudoers \
|
||||||
|
# Enable container mode (disable restart option, etc.)
|
||||||
COPY VERSION /
|
&& echo "1" >> /IS_CONTAINER \
|
||||||
COPY mopidy_iris/ /iris/mopidy_iris
|
# Copy Version file
|
||||||
COPY docker/mopidy/mopidy.example.conf /config/mopidy.conf
|
&& cp /iris/VERSION /
|
||||||
COPY docker/mopidy/pulse-client.conf /etc/pulse/client.conf
|
|
||||||
RUN echo "1" >> /IS_CONTAINER
|
|
||||||
|
|
||||||
# Install mopidy-spotify-gstspotify (Hack, not released yet!)
|
# Install mopidy-spotify-gstspotify (Hack, not released yet!)
|
||||||
# (https://github.com/kingosticks/mopidy-spotify/tree/gstspotifysrc-hack)
|
# (https://github.com/kingosticks/mopidy-spotify/tree/gstspotifysrc-hack)
|
||||||
@ -131,8 +139,8 @@ RUN git clone --depth 1 -b gstspotifysrc-hack https://github.com/kingosticks/mop
|
|||||||
&& cd .. \
|
&& cd .. \
|
||||||
&& rm -rf mopidy-spotify
|
&& rm -rf mopidy-spotify
|
||||||
|
|
||||||
# Install additional Python dependencies
|
# Install additional mopidy extensions and Python dependencies via pip
|
||||||
COPY docker/requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN python3 -m pip install -r requirements.txt
|
RUN python3 -m pip install -r requirements.txt
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
@ -141,16 +149,23 @@ RUN apt-get clean all \
|
|||||||
&& rm -rf /root/.cache \
|
&& rm -rf /root/.cache \
|
||||||
&& rm -rf /iris/node_modules
|
&& rm -rf /iris/node_modules
|
||||||
|
|
||||||
|
# Start helper script.
|
||||||
COPY docker/entrypoint.sh /entrypoint.sh
|
COPY docker/entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
|
# Copy Default configuration for mopidy
|
||||||
|
COPY docker/mopidy/mopidy.example.conf /config/mopidy.conf
|
||||||
|
|
||||||
|
# Copy the pulse-client configuratrion
|
||||||
|
COPY docker/mopidy/pulse-client.conf /etc/pulse/client.conf
|
||||||
|
|
||||||
# Allows any user to run mopidy, but runs by default as a randomly generated UID/GID.
|
# Allows any user to run mopidy, but runs by default as a randomly generated UID/GID.
|
||||||
# RUN useradd -ms /bin/bash mopidy
|
# RUN useradd -ms /bin/bash mopidy
|
||||||
ENV HOME=/var/lib/mopidy
|
ENV HOME=/var/lib/mopidy
|
||||||
RUN set -ex \
|
RUN set -ex \
|
||||||
&& usermod -G audio,sudo,pulse-access mopidy \
|
&& usermod -G audio,sudo,pulse-access mopidy \
|
||||||
&& mkdir /var/lib/mopidy/local \
|
&& mkdir /var/lib/mopidy/local \
|
||||||
&& chown mopidy:audio -R $HOME /entrypoint.sh \
|
&& chown mopidy:audio -R $HOME /entrypoint.sh /iris \
|
||||||
&& chmod go+rwx -R $HOME /entrypoint.sh
|
&& chmod go+rwx -R $HOME /entrypoint.sh /iris
|
||||||
|
|
||||||
# Runs as mopidy user by default.
|
# Runs as mopidy user by default.
|
||||||
USER mopidy:audio
|
USER mopidy:audio
|
||||||
|
|||||||
Reference in New Issue
Block a user