-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
96 lines (88 loc) · 3.15 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
FROM alpine:3.18 as builder
WORKDIR /build
ENV LIBRARY_PATH=/lib:/usr/lib
ENV LIBVORBIS_LIBRARIES=""
ENV VERSION_AUDIOWAVEFORM="1.7.1"
ENV VERSION_LIBSNDFILE="1.2.0"
ENV VERSION_FLAC="1.3.3"
ENV VERSION_OGG="1.3.5"
ENV VERSION_OPUS="1.4"
RUN apk add --no-cache git make cmake gcc g++ samurai libmad-dev zlib-dev zlib-static libpng-static libpng-dev libgd \
libid3tag-dev libsndfile-dev gd-dev boost-static boost-dev build-base autoconf automake gettext libtool libvorbis-dev \
alsa-lib-dev
RUN cp /lib/libz* /usr/lib \
&& wget https://github.com/xiph/ogg/archive/refs/tags/v${VERSION_OGG}.tar.gz \
&& tar xzf v${VERSION_OGG}.tar.gz \
&& cd ogg-${VERSION_OGG} \
&& ./autogen.sh \
&& ./configure --enable-shared=no \
&& make -j${nproc} \
&& make install \
&& cd ../ \
&& wget https://github.com/xiph/opus/archive/v${VERSION_OPUS}.tar.gz \
&& tar xzf v${VERSION_OPUS}.tar.gz \
&& cd opus-${VERSION_OPUS} \
&& ./autogen.sh \
&& ./configure --enable-shared=no \
&& make -j${nproc}\
&& make install \
&& cd ../ \
&& wget https://github.com/xiph/flac/archive/${VERSION_FLAC}.tar.gz \
&& tar xzf ${VERSION_FLAC}.tar.gz \
&& cd flac-${VERSION_FLAC} \
&& ./autogen.sh \
&& ./configure --enable-shared=no \
&& make -j${nproc}\
&& make install \
&& cd ../ \
&& git clone https://github.com/xiph/vorbis.git \
&& cd vorbis \
&& ./autogen.sh \
&& ./configure --enable-shared=no \
&& make -j${nproc}\
&& make install \
&& cd ../ \
&& git clone https://codeberg.org/tenacityteam/libid3tag \
&& cd libid3tag \
&& cmake -B build -G Ninja \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DENABLE_TESTS=YES \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
&& cmake --build build -j $(nproc) \
&& cd build \
&& CTEST_OUTPUT_ON_FAILURE=TRUE ctest \
&& cd .. \
&& cmake --install build \
&& wget https://github.com/libsndfile/libsndfile/archive/${VERSION_LIBSNDFILE}.tar.gz \
&& tar xzf ${VERSION_LIBSNDFILE}.tar.gz \
&& cd libsndfile-${VERSION_LIBSNDFILE} \
&& cmake -B build -G Ninja \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_MPEG=ON \
&& cmake --build build -j $(nproc) \
&& cd build \
&& CTEST_OUTPUT_ON_FAILURE=TRUE ctest -E write_read_test_sd2 \
&& cd ../ \
&& cmake --install build \
&& cd /build \
&& wget https://github.com/bbc/audiowaveform/archive/${VERSION_AUDIOWAVEFORM}.tar.gz \
&& tar xzf ${VERSION_AUDIOWAVEFORM}.tar.gz \
&& cd audiowaveform-${VERSION_AUDIOWAVEFORM} \
&& mkdir build \
&& cd build \
&& cmake -D ENABLE_TESTS=0 -D BUILD_STATIC=1 .. \
&& make -j${nproc}\
&& cp audiowaveform* /bin \
&& cd /build \
&& rm -rf /audiowaveform
FROM alpine:3.18
COPY entrypoint.sh /bin/entrypoint
COPY --from=builder /bin/audiowaveform /bin/audiowaveform
RUN chmod +x /bin/entrypoint /bin/audiowaveform \
&& apk --no-cache add gcc zlib-static libpng-static boost-static \
&& /bin/audiowaveform --version
ENTRYPOINT ["/bin/sh","/bin/entrypoint", "$@"]