-
Notifications
You must be signed in to change notification settings - Fork 213
/
Dockerfile.debug
211 lines (185 loc) · 5.63 KB
/
Dockerfile.debug
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# docker build -t gerbera-debug . -f Dockerfile.debug
ARG BASE_IMAGE=alpine:edge
FROM ${BASE_IMAGE} AS builder
RUN apk add --no-cache \
sudo \
bash \
cmake zlib-dev \
curl-dev \
ffmpeg4-dev \
file-dev \
g++ \
gcc \
gdb \
git \
make \
patch \
tar \
xz \
lsb-release \
mariadb-connector-c-dev \
pkgconf \
sqlite-dev \
tini \
util-linux-dev \
# libexecinfo-dev \
# libexecinfo \
autoconf \
automake \
libtool \
wget \
file
# Build googletest
WORKDIR /gtest_build
COPY scripts/install-googletest.sh scripts/versions.sh ./
COPY scripts/alpine/* ./alpine/
RUN ./install-googletest.sh
# Build fmt
WORKDIR /fmt_build
COPY scripts/install-fmt.sh scripts/versions.sh ./
COPY scripts/alpine/* ./alpine/
RUN ./install-fmt.sh
# Build spdlog
WORKDIR /spdlog_build
COPY scripts/install-spdlog.sh scripts/versions.sh ./
COPY scripts/alpine/* ./alpine/
RUN ./install-spdlog.sh
# Build pugixml
WORKDIR /pugixml_build
COPY scripts/install-pugixml.sh scripts/versions.sh ./
COPY scripts/alpine/* ./alpine/
RUN ./install-pugixml.sh
# Build taglib
WORKDIR /taglib_build
COPY scripts/install-taglib.sh scripts/versions.sh ./
COPY scripts/alpine/* ./alpine/
RUN ./install-taglib.sh
# Build wavpack
WORKDIR /wavpack_build
COPY scripts/install-wavpack.sh scripts/versions.sh ./
COPY scripts/alpine/* ./alpine/
RUN ./install-wavpack.sh
# Build ebml
WORKDIR /ebml_build
COPY scripts/install-ebml.sh scripts/versions.sh ./
COPY scripts/alpine/* ./alpine/
RUN ./install-ebml.sh
# Build matroska
WORKDIR /mastroska_build
COPY scripts/install-matroska.sh scripts/versions.sh ./
COPY scripts/alpine/* ./alpine/
RUN ./install-matroska.sh
# Build duktape
WORKDIR /duktape_build
COPY scripts/install-duktape.sh scripts/versions.sh ./
COPY scripts/alpine/* ./alpine/
RUN ./install-duktape.sh
# Build ffmpegthumbnailer
WORKDIR /ffmpegthumbnailer_build
COPY scripts/install-ffmpegthumbnailer.sh scripts/versions.sh ./
COPY scripts/alpine/* ./alpine/
RUN ./install-ffmpegthumbnailer.sh
# Build libupnp
WORKDIR /libupnp_build
COPY scripts/install-pupnp.sh scripts/versions.sh ./
COPY scripts/alpine/* ./alpine/
RUN ./install-pupnp.sh
# Build libexiv2
WORKDIR /libexiv2_build
COPY scripts/install-libexiv2.sh scripts/versions.sh ./
COPY scripts/alpine/* ./alpine/
RUN ./install-libexiv2.sh
# Build libexif
WORKDIR /libexif_build
COPY scripts/install-libexif.sh scripts/versions.sh ./
COPY scripts/alpine/* ./alpine/
RUN ./install-libexif.sh
# Build Gerbera
WORKDIR /gerbera_build
COPY . .
RUN cmake -S . -B build --preset=develop \
-DWITH_SYSTEMD=NO \
-DBUILD_DOC=NO \
-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=NO \
&& \
cmake --build build -v -j$(nproc) && \
cmake --build build -v -t test ARGS="--output-on-failure"
FROM ${BASE_IMAGE} AS gerbera
RUN apk add --no-cache \
sudo \
bash \
shadow \
curl \
ffmpeg4-libavutil \
ffmpeg4-libavformat \
ffmpeg4-libavcodec \
ffmpeg4-libavfilter \
libjpeg \
file \
libexif \
expat brotli inih inih-inireader \
mariadb-connector-c \
sqlite \
sqlite-libs \
su-exec \
tini \
tzdata \
util-linux \
zlib \
# libexecinfo \
# Transcoding #
ffmpeg4 \
ffmpeg \
libheif-tools \
vlc \
# Debugging
gdb
# Copy libupnp
COPY --from=builder /usr/local/lib/libixml.so* /usr/local/lib/libupnp.so* /usr/lib/
# Copy libexiv2
COPY --from=builder /usr/local/lib/libexiv2.so* /usr/lib/
# Copy libexif
COPY --from=builder /usr/local/lib/libexif.so* /usr/lib/
# Copy ffmpegthumbnailer
COPY --from=builder /usr/local/lib/libffmpegthumbnailer.so* /usr/lib/
# Copy ebml
COPY --from=builder /usr/local/lib/libebml.so* /usr/lib/
# Copy mastroska
COPY --from=builder /usr/local/lib/libmatroska.so* /usr/lib/
# Copy wavpack
COPY --from=builder /usr/local/lib/libwavpack.so* /usr/lib/
# Copy fmt
COPY --from=builder /usr/local/lib/libfmt.so* /usr/lib/
# Copy spdlog
COPY --from=builder /usr/local/lib/libspdlog.so* /usr/lib/
# Copy duktape
COPY --from=builder /usr/local/lib/libduktape.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
ARG IMAGE_USER=gerbera
ARG IMAGE_GROUP=gerbera
ARG IMAGE_UID=1042
ARG IMAGE_GID=1042
ARG IMAGE_PORT=49494
RUN addgroup -S ${IMAGE_GROUP} --gid=${IMAGE_GID} 2>/dev/null && \
adduser -S -D -H -h /var/run/gerbera -s /sbin/nologin -G ${IMAGE_GROUP} -g ${IMAGE_GROUP} --uid=${IMAGE_UID} ${IMAGE_USER} 2>/dev/null && \
addgroup ${IMAGE_USER} video && \
mkdir /var/run/gerbera/ && chmod 2775 /var/run/gerbera/ && \
mkdir /content && chmod 777 /content && ln -s /content /mnt/content && \
mkdir -p /mnt/customization/js && mkdir -p /mnt/customization/shell && \
chmod -R 777 /mnt/customization
# Update entrypoint
RUN chmod 0755 /usr/local/bin/docker-entrypoint.sh \
&& sed "s/\$IMAGE_UID/$IMAGE_UID/g" -i /usr/local/bin/docker-entrypoint.sh \
&& sed "s/\$IMAGE_GID/$IMAGE_GID/g" -i /usr/local/bin/docker-entrypoint.sh \
&& sed "s/\$IMAGE_USER/$IMAGE_USER/g" -i /usr/local/bin/docker-entrypoint.sh \
&& sed "s/\$IMAGE_GROUP/$IMAGE_GROUP/g" -i /usr/local/bin/docker-entrypoint.sh
EXPOSE ${IMAGE_PORT}
EXPOSE 1900/udp
ENTRYPOINT ["/sbin/tini", "--", "docker-entrypoint.sh"]
CMD ["gerbera", "--port", "${IMAGE_PORT}", "--config", "/var/run/gerbera/config.xml"]
FROM gerbera AS default