Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM alpine

RUN apk add --no-cache icecast mailcap
RUN mkdir /etc/icecast \
&& chown icecast:icecast /etc/icecast

ADD ./start-alpine.sh /start.sh
USER icecast

EXPOSE 8000
VOLUME ["/var/log/icecast"]
CMD ["/start.sh"]
26 changes: 26 additions & 0 deletions start-alpine.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

env

set -x

set_val() {
if [ -n "$2" ]; then
echo "set '$2' to '$1'"
sed -i "s/<$2>[^<]*<\/$2>/<$2>$1<\/$2>/g" /etc/icecast/icecast.xml
else
echo "Setting for '$1' is missing, skipping." >&2
fi
}

cp /etc/icecast.xml /etc/icecast/

set_val $ICECAST_SOURCE_PASSWORD source-password
set_val $ICECAST_RELAY_PASSWORD relay-password
set_val $ICECAST_ADMIN_PASSWORD admin-password
set_val $ICECAST_PASSWORD password
set_val $ICECAST_HOSTNAME hostname

set -e

icecast -c /etc/icecast/icecast.xml