Fix for "file exists can't create volume there"

This commit is contained in:
Knut Ahlers 2015-07-09 22:54:22 +02:00
parent 0931219650
commit 6b946e832d
2 changed files with 15 additions and 5 deletions

View file

@ -1,12 +1,12 @@
From ubuntu:14.04
MAINTAINER Knut Ahlers <knut@ahlers.me>
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"]

10
startup.sh Normal file
View file

@ -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