forked from mbentley/docker-ums
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.14-alpine
59 lines (47 loc) · 2.4 KB
/
Dockerfile.14-alpine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# rebased/repackaged base image that only updates existing packages
FROM mbentley/alpine:latest AS tsmuxer-build
# cache buster for tsmuxer
ARG TSMUXER_VER
# install build dependencies
RUN apk add --no-cache build-base bzip2-static cmake file freetype-static freetype-dev g++ git libc6-compat libpng-static zlib-dev zlib-static
# copy in build script
COPY build-tsmuxer.sh /
# build tsMuxeR
RUN /build-tsmuxer.sh
# final image with UMS + copy over the compiled tsmuxer
# rebased/repackaged base image that only updates existing packages
FROM mbentley/alpine:latest
LABEL maintainer="Matt Bentley <[email protected]>"
ENV UMS_PROFILE=/opt/ums/UMS.conf \
JAVA_OPTS="-XX:+UseContainerSupport"
# add build arg for cache busting
ARG UMSVER
# install dependencies per https://github.com/UniversalMediaServer/UniversalMediaServer/wiki/Linux-install-instructions
# get latest release number and use that to install UMS; fail to install if version is not 14.x
RUN apk add --no-cache coreutils flac jq iputils mediainfo mplayer openjdk17-jre vlc &&\
UMSVER=$(if [ -z "${UMSVER}" ]; then wget -q -O - https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/releases/latest | jq -r .name; else echo "${UMSVER}"; fi) &&\
MYARCH="$(arch)" &&\
if [ "${MYARCH}" = "x86_64" ]; then UMSARCH="x86_64"; elif [ "${MYARCH}" = "arm64" ] || [ "${MYARCH}" = "aarch64" ]; then UMSARCH="arm64"; else echo "unsupported archtecture"; exit 1; fi &&\
apk del --purge --no-cache jq &&\
if [ "$(echo $UMSVER | awk -F '.' '{print $1}')" -ne "14" ]; then echo "Latest version number is no longer 14"; exit 1; fi &&\
wget -nv "https://github.com/UniversalMediaServer/UniversalMediaServer/releases/download/${UMSVER}/UMS-${UMSVER}-${UMSARCH}.tgz" -O /opt/UMS-${UMSVER}.tgz &&\
cd /opt &&\
tar zxf UMS-${UMSVER}.tgz &&\
rm UMS-${UMSVER}.tgz &&\
mv ums-${UMSVER} ums &&\
rm -rf /opt/ums/jre* &&\
rm -f /opt/ums/linux/tsMuxeR* &&\
mkdir /opt/ums/database /opt/ums/data /var/log/UMS &&\
addgroup -g 500 ums &&\
adduser -u 500 -G ums -h /opt/ums -D ums &&\
chown -R ums:ums /opt/ums /var/log/UMS &&\
rm -rf /media/*
# bring over tsmuxer
COPY --from=tsmuxer-build /tsMuxer/bin/tsMuxeR /opt/ums/linux/tsMuxeR
# add the entrypoint
COPY entrypoint.sh /entrypoint.sh
WORKDIR /opt/ums
EXPOSE 1900/udp 2869 5001 9001
VOLUME ["/tmp","/opt/ums/database","/opt/ums/data","/var/log/UMS"]
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/opt/ums/UMS.sh"]