Changed Docker builds, add static and shared debian
This commit is contained in:
parent
9ae28eedaa
commit
53fd0c93f2
|
@ -53,7 +53,7 @@ ENV GOPROXY=${GOPROXY}
|
|||
COPY go.mod go.sum ./
|
||||
RUN go mod download -x && go mod verify
|
||||
|
||||
COPY . .
|
||||
COPY .. .
|
||||
|
||||
RUN go build -v -ldflags '-linkmode external -extldflags "-Wl,-z,stack-size=2097152 -fno-PIC -static -lstdc++"' -buildmode pie -tags 'osusergo netgo static_build' \
|
||||
-o /usr/bin/ git.gammaspectra.live/S.O.N.G/Ignite/cli/encode-libaom git.gammaspectra.live/S.O.N.G/Ignite/cli/encode-server
|
66
build/debian-shared/Dockerfile
Normal file
66
build/debian-shared/Dockerfile
Normal file
|
@ -0,0 +1,66 @@
|
|||
FROM golang:1.21-bookworm AS builder
|
||||
|
||||
ENV CFLAGS="-march=native -Ofast"
|
||||
ENV CXXFLAGS="-march=native -Ofast"
|
||||
ENV CGO_CFLAGS="-march=native -Ofast"
|
||||
|
||||
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
|
||||
git gcc g++ musl-dev bash nasm autoconf automake cmake make libtool gettext pkg-config meson ccache perl xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENV PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/lib64/pkgconfig
|
||||
|
||||
ARG X264_TAG="stable"
|
||||
RUN git clone --depth 1 --branch "${X264_TAG}" https://code.videolan.org/videolan/x264.git /tmp/x264 && cd /tmp/x264 && \
|
||||
./configure --disable-cli --disable-ffms --disable-lavf --disable-swscale --enable-shared --bit-depth=all --chroma-format=all --enable-lto --enable-pic --disable-opencl --prefix=/usr && \
|
||||
make -j$(nproc) && \
|
||||
make install && \
|
||||
cd / && \
|
||||
rm -rf /tmp/x264
|
||||
|
||||
ARG VMAF_TAG="v2.3.1"
|
||||
RUN git clone --depth 1 --branch "${VMAF_TAG}" https://github.com/Netflix/vmaf.git /tmp/vmaf && cd /tmp/vmaf/libvmaf && \
|
||||
meson setup build . --prefix /usr --buildtype release --default-library=static \
|
||||
-Denable_float=true -Dbuilt_in_models=true -Denable_tests=false -Denable_docs=false && \
|
||||
ninja -vC build && \
|
||||
ninja -vC build install && \
|
||||
cd / && \
|
||||
rm -rf /tmp/vmaf
|
||||
|
||||
ARG DAV1D_TAG="1.3.0"
|
||||
RUN git clone --depth 1 --branch "${DAV1D_TAG}" https://code.videolan.org/videolan/dav1d.git /tmp/dav1d && cd /tmp/dav1d && \
|
||||
meson setup build . --prefix /usr --buildtype release --default-library=shared && \
|
||||
ninja -vC build && \
|
||||
ninja -vC build install && \
|
||||
cd / && \
|
||||
rm -rf /tmp/dav1d
|
||||
|
||||
ARG AOM_TAG="v3.7.0"
|
||||
RUN git clone --depth 1 --branch "${AOM_TAG}" https://aomedia.googlesource.com/aom.git /tmp/aom && cd /tmp/aom && \
|
||||
mkdir b && cd b && \
|
||||
cmake .. -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -D CMAKE_INSTALL_PREFIX:PATH=/usr \
|
||||
-DENABLE_DOCS=OFF -DENABLE_EXAMPLES=OFF -DENABLE_TOOLS=OFF -DENABLE_TESTS=OFF -DENABLE_CCACHE=ON -DCONFIG_FRAME_PARALLEL_ENCODE=1 -DCONFIG_AV1_TEMPORAL_DENOISING=1 \
|
||||
-DCONFIG_BITRATE_ACCURACY=1 -DCONFIG_TUNE_VMAF=1 -DCONFIG_NN_V2=1 -DCONFIG_RT_ML_PARTITIONING=1 -DCONFIG_THREE_PASS=0 -DCONFIG_AV1_ENCODER=1 -DCONFIG_AV1_DECODER=1 && \
|
||||
make -j$(nproc) && \
|
||||
make install && \
|
||||
cd / && \
|
||||
rm -rf /tmp/aom
|
||||
|
||||
WORKDIR /usr/src/Ignite
|
||||
|
||||
ARG GOPROXY=""
|
||||
ENV GOPROXY=${GOPROXY}
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download -x && go mod verify
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN go build -v \
|
||||
-o /usr/bin/ git.gammaspectra.live/S.O.N.G/Ignite/cli/encode-libaom git.gammaspectra.live/S.O.N.G/Ignite/cli/encode-server
|
||||
RUN CGO_ENABLED=0 go build -v \
|
||||
-o /usr/bin/encode-pool git.gammaspectra.live/S.O.N.G/Ignite/cli/encode-pool
|
||||
|
||||
WORKDIR /
|
71
build/debian/Dockerfile
Normal file
71
build/debian/Dockerfile
Normal file
|
@ -0,0 +1,71 @@
|
|||
FROM golang:1.21-bookworm AS builder
|
||||
|
||||
ENV CFLAGS="-march=native -Ofast"
|
||||
ENV CXXFLAGS="-march=native -Ofast"
|
||||
ENV LDFLAGS="-flto -static -static-libstdc++"
|
||||
ENV CGO_CFLAGS="-march=native -Ofast"
|
||||
|
||||
ARG X264_TAG="stable"
|
||||
ARG VMAF_TAG="v2.3.1"
|
||||
ARG AOM_TAG="v3.7.0"
|
||||
ARG DAV1D_TAG="1.3.0"
|
||||
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
|
||||
git gcc g++ musl-dev bash nasm autoconf automake cmake make libtool gettext pkg-config meson ccache perl xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENV PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/lib64/pkgconfig
|
||||
|
||||
RUN git clone --depth 1 --branch "${X264_TAG}" https://code.videolan.org/videolan/x264.git /tmp/x264 && cd /tmp/x264 && \
|
||||
./configure --disable-cli --disable-ffms --disable-lavf --disable-swscale --enable-static --bit-depth=all --chroma-format=all --enable-lto --enable-pic --disable-opencl --prefix=/usr && \
|
||||
make -j$(nproc) && \
|
||||
make install && \
|
||||
cd / && \
|
||||
rm -rf /tmp/x264
|
||||
|
||||
RUN git clone --depth 1 --branch "${VMAF_TAG}" https://github.com/Netflix/vmaf.git /tmp/vmaf && cd /tmp/vmaf/libvmaf && \
|
||||
meson setup build . --prefix /usr --buildtype release --default-library=static \
|
||||
-Denable_float=true -Dbuilt_in_models=true -Denable_tests=false -Denable_docs=false && \
|
||||
ninja -vC build && \
|
||||
ninja -vC build install && \
|
||||
cd / && \
|
||||
rm -rf /tmp/vmaf
|
||||
|
||||
RUN git clone --depth 1 --branch "${AOM_TAG}" https://aomedia.googlesource.com/aom.git /tmp/aom && cd /tmp/aom && \
|
||||
mkdir b && cd b && \
|
||||
cmake .. -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -D CMAKE_INSTALL_PREFIX:PATH=/usr \
|
||||
-DENABLE_DOCS=OFF -DENABLE_EXAMPLES=OFF -DENABLE_TOOLS=OFF -DENABLE_TESTS=OFF -DENABLE_CCACHE=ON -DCONFIG_FRAME_PARALLEL_ENCODE=1 -DCONFIG_AV1_TEMPORAL_DENOISING=1 \
|
||||
-DCONFIG_BITRATE_ACCURACY=1 -DCONFIG_TUNE_VMAF=1 -DCONFIG_NN_V2=1 -DCONFIG_RT_ML_PARTITIONING=1 -DCONFIG_THREE_PASS=0 -DCONFIG_AV1_ENCODER=1 -DCONFIG_AV1_DECODER=1 && \
|
||||
make -j$(nproc) && \
|
||||
make install && \
|
||||
cd / && \
|
||||
rm -rf /tmp/aom
|
||||
|
||||
RUN git clone --depth 1 --branch "${DAV1D_TAG}" https://code.videolan.org/videolan/dav1d.git /tmp/dav1d && cd /tmp/dav1d && \
|
||||
meson setup build . --prefix /usr --buildtype release --default-library=static && \
|
||||
ninja -vC build && \
|
||||
ninja -vC build install && \
|
||||
cd / && \
|
||||
rm -rf /tmp/dav1d
|
||||
|
||||
WORKDIR /usr/src/Ignite
|
||||
|
||||
ARG GOPROXY=""
|
||||
ENV GOPROXY=${GOPROXY}
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download -x && go mod verify
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN go build -v -ldflags '-linkmode external -extldflags "-fno-PIC -static -lstdc++"' -buildmode pie -tags 'osusergo netgo static_build' \
|
||||
-o /usr/bin/ git.gammaspectra.live/S.O.N.G/Ignite/cli/encode-libaom git.gammaspectra.live/S.O.N.G/Ignite/cli/encode-server
|
||||
RUN CGO_ENABLED=0 go build -v -tags 'osusergo netgo static_build' \
|
||||
-o /usr/bin/encode-pool git.gammaspectra.live/S.O.N.G/Ignite/cli/encode-pool
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
COPY --from=builder /usr/bin/encode-* /usr/bin/
|
||||
|
||||
WORKDIR /
|
Loading…
Reference in a new issue