forked from pytorch/audio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
56 lines (51 loc) · 1.65 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
FROM ubuntu:18.04 as builder
RUN apt update -q
################################################################################
# Build Kaldi
################################################################################
RUN apt install -q -y \
autoconf \
automake \
bzip2 \
g++ \
gfortran \
git \
libatlas-base-dev \
libtool \
make \
python2.7 \
python3 \
sox \
subversion \
unzip \
wget \
zlib1g-dev
# KALDI uses MKL as a default math library, but we are going to copy featbin binaries and dependent
# shared libraries to the final image, so we use ATLAS, which is easy to reinstall in the final image.
RUN git clone --depth 1 https://github.com/kaldi-asr/kaldi.git /opt/kaldi && \
cd /opt/kaldi/tools && \
make -j $(nproc) && \
cd /opt/kaldi/src && \
./configure --shared --mathlib=ATLAS --use-cuda=no && \
make featbin -j $(nproc)
# Copy featbins and dependent libraries
ADD ./scripts /scripts
RUN bash /scripts/copy_kaldi_executables.sh /opt/kaldi /kaldi
################################################################################
# Build the final image
################################################################################
FROM BASE_IMAGE
RUN apt update && apt install -y \
g++ \
gfortran \
git \
libatlas3-base \
libsndfile1 \
wget \
curl \
make \
file \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /kaldi /kaldi
ENV PATH="${PATH}:/kaldi/bin" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/kaldi/lib"