mirror of
https://github.com/pstrueb/piper.git
synced 2026-04-17 22:05:30 +00:00
Fix docker build
This commit is contained in:
@@ -1,6 +1,4 @@
|
|||||||
*
|
*
|
||||||
!VERSION
|
!VERSION
|
||||||
!Makefile
|
|
||||||
!src/cpp/
|
!src/cpp/
|
||||||
!local/en-us/lessac/low/en-us-lessac-low.onnx
|
!CMakeLists.txt
|
||||||
!local/en-us/lessac/low/en-us-lessac-low.onnx.json
|
|
||||||
|
|||||||
47
Dockerfile
47
Dockerfile
@@ -1,47 +1,20 @@
|
|||||||
FROM quay.io/pypa/manylinux_2_28_x86_64 as build-amd64
|
FROM debian:bullseye as build
|
||||||
|
|
||||||
FROM quay.io/pypa/manylinux_2_28_aarch64 as build-arm64
|
|
||||||
|
|
||||||
FROM debian:bullseye as build-armv7
|
|
||||||
|
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get install --yes --no-install-recommends \
|
|
||||||
build-essential cmake ca-certificates curl pkg-config
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
ARG TARGETARCH
|
|
||||||
ARG TARGETVARIANT
|
|
||||||
FROM build-${TARGETARCH}${TARGETVARIANT} as build
|
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
ARG TARGETVARIANT
|
ARG TARGETVARIANT
|
||||||
|
|
||||||
ENV LANG C.UTF-8
|
ENV LANG C.UTF-8
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install --yes --no-install-recommends \
|
||||||
|
build-essential cmake ca-certificates curl pkg-config git
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
ARG SPDLOG_VERSION="1.11.0"
|
COPY ./ ./
|
||||||
RUN curl -L "https://github.com/gabime/spdlog/archive/refs/tags/v${SPDLOG_VERSION}.tar.gz" | \
|
RUN cmake -Bbuild -DCMAKE_INSTALL_PREFIX=install
|
||||||
tar -xzvf - && \
|
RUN cmake --build build --config Release
|
||||||
mkdir -p "spdlog-${SPDLOG_VERSION}/build" && \
|
RUN cmake --install build
|
||||||
cd "spdlog-${SPDLOG_VERSION}/build" && \
|
|
||||||
cmake .. && \
|
|
||||||
make -j8 && \
|
|
||||||
cmake --install . --prefix /usr
|
|
||||||
|
|
||||||
RUN mkdir -p "lib/Linux-$(uname -m)"
|
|
||||||
|
|
||||||
# Use pre-compiled Piper phonemization library (includes onnxruntime)
|
|
||||||
ARG PIPER_PHONEMIZE_VERSION='1.1.0'
|
|
||||||
RUN mkdir -p "lib/Linux-$(uname -m)/piper_phonemize" && \
|
|
||||||
curl -L "https://github.com/rhasspy/piper-phonemize/releases/download/v${PIPER_PHONEMIZE_VERSION}/libpiper_phonemize-${TARGETARCH}${TARGETVARIANT}.tar.gz" | \
|
|
||||||
tar -C "lib/Linux-$(uname -m)/piper_phonemize" -xzvf -
|
|
||||||
|
|
||||||
# Build piper binary
|
|
||||||
COPY VERSION Makefile ./
|
|
||||||
COPY src/cpp/ ./src/cpp/
|
|
||||||
RUN make
|
|
||||||
|
|
||||||
# Do a test run
|
# Do a test run
|
||||||
RUN ./build/piper --help
|
RUN ./build/piper --help
|
||||||
@@ -49,7 +22,7 @@ RUN ./build/piper --help
|
|||||||
# Build .tar.gz to keep symlinks
|
# Build .tar.gz to keep symlinks
|
||||||
WORKDIR /dist
|
WORKDIR /dist
|
||||||
RUN mkdir -p piper && \
|
RUN mkdir -p piper && \
|
||||||
cp -dR /build/build/*.so* /build/build/espeak-ng-data /build/build/libtashkeel_model.ort /build/build/piper ./piper/ && \
|
cp -dR /build/install/* ./piper/ && \
|
||||||
tar -czf "piper_${TARGETARCH}${TARGETVARIANT}.tar.gz" piper/
|
tar -czf "piper_${TARGETARCH}${TARGETVARIANT}.tar.gz" piper/
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user