MeteorLight/Dockerfile

115 lines
3.6 KiB
Docker
Raw Permalink Normal View History

2022-08-02 18:58:59 +00:00
FROM golang:1.19-alpine AS builder
2022-03-02 18:11:12 +00:00
WORKDIR /src
2022-07-20 10:13:39 +00:00
ENV CFLAGS="-march=native -Ofast -flto"
ENV CXXFLAGS="-march=native -Ofast -flto"
ENV LDFLAGS="-flto"
ENV CGO_CFLAGS="-march=native -Ofast"
2022-07-21 16:27:40 +00:00
RUN apk update && apk add --no-cache \
git gcc g++ musl-dev bash autoconf automake cmake make libtool gettext \
openssl-dev
RUN git clone --depth 1 --branch v1.2.6 https://github.com/jiixyj/libebur128.git && cd libebur128 && \
2022-07-21 16:27:40 +00:00
mkdir build && cd build && \
cmake .. -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX:PATH=/usr && \
make -j$(nproc) && \
make install && \
cd ../..
RUN git clone --depth 1 --branch 0.2.2 https://github.com/libsndfile/libsamplerate.git && cd libsamplerate && \
2022-03-02 18:11:12 +00:00
./autogen.sh && \
./configure --prefix /usr && \
make -j$(nproc) && \
2022-07-20 10:13:39 +00:00
make install && \
cd ..
RUN wget https://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz -O lame-3.100.tar.gz && \
2022-07-20 10:13:39 +00:00
tar -xzvf lame-3.100.tar.gz && \
cd lame-3.100 && \
./configure --prefix /usr && \
make -j$(nproc) && \
2022-07-20 10:13:39 +00:00
make install && \
cd ..
RUN git clone --depth 1 --branch v1.3.5 https://gitlab.xiph.org/xiph/ogg.git && cd ogg && \
2022-07-20 10:13:39 +00:00
./autogen.sh && \
./configure --prefix /usr && \
make -j$(nproc) && \
2022-07-20 10:13:39 +00:00
make install && \
cd ..
RUN git clone --branch master https://gitlab.xiph.org/xiph/opus.git && cd opus && \
2022-07-20 10:13:39 +00:00
./autogen.sh && \
./configure --enable-float-approx --prefix /usr && \
make -j$(nproc) && \
2022-07-20 10:13:39 +00:00
make install && \
cd ..
RUN git clone --depth 1 --branch v0.12 https://gitlab.xiph.org/xiph/opusfile.git && cd opusfile && \
2022-07-20 10:13:39 +00:00
./autogen.sh && \
./configure --prefix /usr && \
make -j$(nproc) && \
2022-07-20 10:13:39 +00:00
make install && \
cd ..
RUN git clone --depth 1 --branch master https://gitlab.xiph.org/xiph/libopusenc.git && cd libopusenc && \
2022-07-20 10:13:39 +00:00
./autogen.sh && \
./configure --prefix /usr && \
make -j$(nproc) && \
2022-07-20 10:13:39 +00:00
make install && \
cd ..
RUN git clone --depth 1 --branch v1.3.7 https://gitlab.xiph.org/xiph/vorbis.git && cd vorbis && \
./autogen.sh && \
./configure --prefix /usr && \
make -j$(nproc) && \
make install && \
cd ..
RUN git clone --depth 1 --branch 1.3.4 https://gitlab.xiph.org/xiph/flac.git && cd flac && \
2022-07-20 10:13:39 +00:00
./autogen.sh && \
./configure --prefix /usr && \
make -j$(nproc) && \
2022-07-20 10:13:39 +00:00
make install && \
cd ..
RUN git clone --depth 1 https://github.com/mstorsjo/fdk-aac.git && cd fdk-aac && \
2022-03-02 18:11:12 +00:00
./autogen.sh && \
./configure --prefix /usr && \
make -j$(nproc) && \
make install && \
cd ..
RUN git clone --depth 1 https://git.gammaspectra.live/S.O.N.G/alac.git && cd alac && \
2022-04-21 12:06:35 +00:00
autoreconf -fi && \
./configure --prefix /usr && \
make -j$(nproc) && \
make install && \
cd ..
RUN rm -rf /src/libebur128 /src/libsamplerate /src/lame-3.100 /src/ogg /src/opus /src/opusfile /src/vorbis /src/flac /src/libopusenc /src/fdk-aac /src/alac
2022-03-02 18:11:12 +00:00
COPY . /code
WORKDIR /code
2022-07-20 10:13:39 +00:00
2022-03-02 18:11:12 +00:00
RUN go build -v -o /usr/bin/MeteorLight . && rm -rf /code
FROM alpine:latest
COPY --from=builder /usr/lib/libmp3lame* /usr/lib/
COPY --from=builder /usr/lib/libsamplerate* /usr/lib/
COPY --from=builder /usr/lib/libfdk* /usr/lib/
COPY --from=builder /usr/lib/libFLAC* /usr/lib/
COPY --from=builder /usr/lib/libopus* /usr/lib/
COPY --from=builder /usr/lib/libogg* /usr/lib/
COPY --from=builder /usr/lib/libvorbis* /usr/lib/
COPY --from=builder /usr/lib/libebur128* /usr/lib/
COPY --from=builder /usr/lib/libalac* /usr/lib/
COPY --from=builder /usr/bin/MeteorLight /usr/bin/MeteorLight
2022-03-02 18:11:12 +00:00
WORKDIR /
2022-03-02 18:11:12 +00:00
ENTRYPOINT ["/usr/bin/MeteorLight"]