Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Add alpine-based docker image #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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