forked from gerbera/gerbera
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
119 lines (106 loc) · 2.81 KB
/
Dockerfile
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
ARG BASE_IMAGE=alpine:3.17
FROM ${BASE_IMAGE} AS builder
RUN apk add --no-cache \
bash \
cmake zlib-dev \
curl-dev \
duktape-dev \
ffmpeg4-dev \
file-dev \
fmt-dev \
g++ \
gcc \
git \
libebml-dev \
libexif-dev \
libmatroska-dev \
wavpack wavpack-dev \
make \
mariadb-connector-c-dev \
pkgconf \
pugixml-dev \
spdlog-dev \
sqlite-dev \
taglib-dev \
tini \
util-linux-dev \
# packages to build libupnp
autoconf \
automake \
libtool \
file
# Build ffmpegthumbnailer
WORKDIR /ffmpegthumbnailer_build
COPY scripts/install-ffmpegthumbnailer.sh scripts/versions.sh ./
RUN ./install-ffmpegthumbnailer.sh
# Build libupnp
WORKDIR /libupnp_build
COPY scripts/install-pupnp.sh scripts/versions.sh ./
RUN ./install-pupnp.sh
# Build Gerbera
WORKDIR /gerbera_build
COPY . .
RUN cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS=-g1 \
-DWITH_MAGIC=YES \
-DWITH_MYSQL=YES \
-DWITH_CURL=YES \
-DWITH_JS=YES \
-DWITH_TAGLIB=YES \
-DWITH_AVCODEC=YES \
-DWITH_FFMPEGTHUMBNAILER=YES \
-DWITH_WAVPACK=YES \
-DWITH_EXIF=YES \
-DWITH_LASTFM=NO \
-DWITH_SYSTEMD=NO \
-DWITH_DEBUG=YES \
&& \
cmake --build build -v -j$(nproc)
FROM ${BASE_IMAGE} AS gerbera
RUN apk add --no-cache \
curl \
duktape \
ffmpeg4-libs \
file \
fmt \
libebml \
libexif \
libmatroska \
wavpack \
mariadb-connector-c \
pugixml \
spdlog \
sqlite \
sqlite-libs \
su-exec \
taglib \
tini \
tzdata \
util-linux \
zlib
# Copy libupnp
COPY --from=builder /usr/local/lib/libixml.so* /usr/local/lib/libupnp.so* /usr/lib/
# Copy ffmpegthumbnailer
COPY --from=builder /usr/local/lib/libffmpegthumbnailer.so* /usr/lib/
# Copy Gerbera
COPY --from=builder /gerbera_build/build/gerbera /bin/gerbera
COPY --from=builder /gerbera_build/scripts/js /usr/local/share/gerbera/js
COPY --from=builder /gerbera_build/web /usr/local/share/gerbera/web
COPY --from=builder /gerbera_build/src/database/*/*.sql /gerbera_build/src/database/*/*.xml /usr/local/share/gerbera/
COPY --from=builder /gerbera_build/scripts/docker/docker-entrypoint.sh /usr/local/bin
RUN addgroup -S gerbera 2>/dev/null && \
adduser -S -D -H -h /var/run/gerbera -s /sbin/nologin -G gerbera -g gerbera gerbera 2>/dev/null && \
mkdir /var/run/gerbera/ && chmod 2775 /var/run/gerbera/ && \
mkdir /content && chmod 777 /content
EXPOSE 49494
EXPOSE 1900/udp
ENTRYPOINT ["/sbin/tini", "--", "docker-entrypoint.sh"]
CMD ["gerbera","--port", "49494", "--config", "/var/run/gerbera/config.xml"]
FROM gerbera AS with_transcoding
RUN apk add --no-cache \
ffmpeg4-libs \
ffmpeg \
libheif-tools \
vlc
FROM gerbera AS default