From 15943369d46fa665fa23d06f88e2e41528af2cd9 Mon Sep 17 00:00:00 2001 From: James Barnsley Date: Mon, 10 Feb 2020 07:15:22 +1300 Subject: [PATCH] Using crude but predictable file to detect when running in docker, #489 --- Dockerfile | 3 ++- mopidy_iris/system.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 17dc4018..b2a9c121 100755 --- a/Dockerfile +++ b/Dockerfile @@ -63,7 +63,8 @@ ENV HOME=/var/lib/mopidy RUN set -ex \ && usermod -G audio,sudo mopidy \ && chown mopidy:audio -R $HOME /entrypoint.sh /iris \ - && chmod go+rwx -R $HOME /entrypoint.sh /iris + && chmod go+rwx -R $HOME /entrypoint.sh /iris \ + && echo "1" >> $HOME/IS_CONTAINER # Runs as mopidy user by default. USER mopidy:audio diff --git a/mopidy_iris/system.sh b/mopidy_iris/system.sh index 8cab6273..bf2e1544 100755 --- a/mopidy_iris/system.sh +++ b/mopidy_iris/system.sh @@ -1,6 +1,6 @@ #!/bin/bash -if [[ "$(pwd)" = "/iris" ]]; then +if [ -f "/var/lib/mopidy/IS_CONTAINER" ]; then IS_CONTAINER=true else IS_CONTAINER=false