Adds dumb-init to avoid any PID 1 issue.

This commit is contained in:
Werner Beroux
2017-02-20 12:41:59 +01:00
parent d21ad4a209
commit e52fc40350

View File

@@ -6,9 +6,9 @@ COPY mopidy.conf /var/lib/mopidy/.config/mopidy/mopidy.conf
# Start helper script
COPY entrypoint.sh /entrypoint.sh
# Official Mopidy install for Debian/Ubuntu along with some extensions
# (see https://docs.mopidy.com/en/latest/installation/debian/ )
RUN set -ex \
# Official Mopidy install for Debian/Ubuntu along with some extensions
# (see https://docs.mopidy.com/en/latest/installation/debian/ )
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
curl \
@@ -30,11 +30,18 @@ RUN set -ex \
Mopidy-GMusic \
Mopidy-YouTube \
pyasn1==0.1.8 \
# Install dumb-init
# https://github.com/Yelp/dumb-init
&& DUMP_INIT_URI=$(curl -L https://github.com/Yelp/dumb-init/releases/latest | grep -Po '(?<=href=")[^"]+_amd64(?=")') \
&& curl -Lo /usr/local/bin/dumb-init "https://github.com/$DUMP_INIT_URI" \
&& chmod +x /usr/local/bin/dumb-init \
# Clean-up
&& apt-get purge --auto-remove -y \
curl \
gcc \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.cache \
# Limited access rights.
&& chown mopidy:audio -R /var/lib/mopidy/.config \
&& chown mopidy:audio /entrypoint.sh
@@ -45,5 +52,5 @@ VOLUME ["/var/lib/mopidy/local", "/var/lib/mopidy/media"]
EXPOSE 6600 6680
ENTRYPOINT ["/entrypoint.sh"]
ENTRYPOINT ["/usr/local/bin/dumb-init", "/entrypoint.sh"]
CMD ["/usr/bin/mopidy"]