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