Switch to alpine for icecast2 server

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-12-21 01:46:54 +01:00
parent 6b946e832d
commit 1480b5faca
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
2 changed files with 25 additions and 9 deletions

View file

@ -1,12 +1,27 @@
From ubuntu:14.04
MAINTAINER Knut Ahlers <knut@ahlers.me>
FROM alpine:3.8
RUN apt-get update \
&& DEBCONF_FRONTEND=noninteractive apt-get install -y icecast2
LABEL maintainer Knut Ahlers <knut@ahlers.me>
ENV DUMB_INIT_VERSION=1.2.2 \
GOSU_VERSION=1.11
RUN set -ex \
&& apk --no-cache add \
bash \
curl \
icecast \
mailcap \
&& curl -sSfLo /usr/bin/dumb-init "https://github.com/Yelp/dumb-init/releases/download/v${DUMB_INIT_VERSION}/dumb-init_${DUMB_INIT_VERSION}_amd64" \
&& curl -sSfLo /usr/bin/gosu "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64" \
&& chmod 0755 \
/usr/bin/dumb-init \
/usr/bin/gosu \
&& apk --no-cache del \
curl
VOLUME /config
EXPOSE 8000 8001
ADD startup.sh /usr/bin/startup.sh
ENTRYPOINT ["/bin/bash", "/usr/bin/startup.sh"]
ENTRYPOINT ["/usr/bin/startup.sh"]

9
startup.sh Normal file → Executable file
View file

@ -1,10 +1,11 @@
#!/bin/bash
#!/usr/bin/dumb-init /bin/bash
set -euxo pipefail
# 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
cp /etc/icecast.xml /config/icecast.xml
chown icecast /config/icecast.xml
fi
# Hand over to icecast
sudo -u icecast2 /usr/bin/icecast2 -c /config/icecast.xml
exec gosu icecast /usr/bin/icecast -c /config/icecast.xml