File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # Using kaldi image for pre-built OpenFST, version is 1.7.2
2- FROM kaldiasr/kaldi:cpu-debian10-2024-07-29 as kaldi-base
1+ # Stage 1: Build OpenFST 1.7.2 from source
2+ FROM debian:bookworm as openfst-builder
33
4- FROM debian:11
4+ ARG OPENFST_VERSION=1.7.2
5+ ARG JOBS=4
6+
7+ # Install build dependencies for OpenFST
8+ RUN apt-get update && \
9+ apt-get upgrade -y && \
10+ apt-get install -y --no-install-recommends \
11+ g++ \
12+ make \
13+ && rm -rf /var/lib/apt/lists/*
14+
15+ # Copy and build OpenFST from local tarball
16+ WORKDIR /tmp
17+ COPY ext/openfst-${OPENFST_VERSION}.tar.gz /tmp/
18+ RUN tar -xzf openfst-${OPENFST_VERSION}.tar.gz && \
19+ cd openfst-${OPENFST_VERSION} && \
20+ ./configure --prefix=/opt/openfst --enable-shared --enable-static && \
21+ make -j${JOBS} && \
22+ make install && \
23+ cd .. && \
24+ rm -rf openfst-${OPENFST_VERSION} openfst-${OPENFST_VERSION}.tar.gz
25+
26+ # Stage 2: Build fstalign
27+ FROM debian:bookworm
528
6- COPY --from=kaldi-base /opt/kaldi/tools /openfst /opt/openfst
29+ COPY --from=openfst-builder /opt/openfst /opt/openfst
730ENV OPENFST_ROOT /opt/openfst
831
932ARG JOBS=4
1033
34+ # Install runtime and build dependencies
1135RUN apt-get update && \
1236 apt-get upgrade -y && \
13- apt-get -y install \
37+ apt-get install -y --no- install-recommends \
1438 cmake \
1539 g++ \
16- libicu-dev
40+ make \
41+ libicu-dev \
42+ && rm -rf /var/lib/apt/lists/*
1743
1844RUN mkdir /fstalign
1945COPY CMakeLists.txt /fstalign/CMakeLists.txt
You can’t perform that action at this time.
0 commit comments