From 6b946e832d8cd1a1fa3b2fe13963d4ffd72d4bf1 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Thu, 9 Jul 2015 22:54:22 +0200 Subject: [PATCH] Fix for "file exists can't create volume there" --- Dockerfile | 10 +++++----- startup.sh | 10 ++++++++++ 2 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 startup.sh diff --git a/Dockerfile b/Dockerfile index 40ad510..8a7cbf6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,12 @@ From ubuntu:14.04 MAINTAINER Knut Ahlers -RUN apt-get update && \ - apt-get install -y icecast2 +RUN apt-get update \ + && DEBCONF_FRONTEND=noninteractive apt-get install -y icecast2 -VOLUME /etc/icecast2/icecast.xml +VOLUME /config EXPOSE 8000 8001 -USER icecast2 +ADD startup.sh /usr/bin/startup.sh -ENTRYPOINT ["/usr/bin/icecast2", "-c", "/etc/icecast2/icecast.xml"] +ENTRYPOINT ["/bin/bash", "/usr/bin/startup.sh"] diff --git a/startup.sh b/startup.sh new file mode 100644 index 0000000..3e493e6 --- /dev/null +++ b/startup.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Copy default config to /config if not existent +if ! [ -e /config/icecast.xml ]; then + cp /etc/icecast2/icecast.xml /config/icecast.xml + chown icecast2 /config/icecast.xml +fi + +# Hand over to icecast +sudo -u icecast2 /usr/bin/icecast2 -c /config/icecast.xml