forked from flashlight/wav2letter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-CPU-Base
79 lines (77 loc) · 3.14 KB
/
Dockerfile-CPU-Base
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# ==================================================================
# module list
# ------------------------------------------------------------------
# inherit from flml/flashlight:cpu-base-latest
# libsndfile 4bdd741 (git)
# FFTW latest (apt)
# KenLM e47088d (git)
# GLOG latest (apt)
# gflags latest (apt)
# python 3.6 (apt)
# ==================================================================
FROM flml/flashlight:cpu-base-latest
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive $APT_INSTALL \
# for libsndfile
autoconf automake autogen build-essential libasound2-dev \
libflac-dev libogg-dev libtool libvorbis-dev pkg-config python \
# for libsndfile for ubuntu 18.04
libopus-dev \
# FFTW
libfftw3-dev \
# for kenlm
zlib1g-dev libbz2-dev liblzma-dev libboost-all-dev \
# gflags
libgflags-dev libgflags2.2 \
# for glog
libgoogle-glog-dev libgoogle-glog0v5 \
# for receipts data processing
sox && \
# ==================================================================
# python (for receipts data processing)
# ------------------------------------------------------------------
PIP_INSTALL="python3 -m pip --no-cache-dir install --upgrade" && \
DEBIAN_FRONTEND=noninteractive $APT_INSTALL \
software-properties-common \
&& \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive $APT_INSTALL \
python3.6 \
python3.6-dev \
&& \
wget -O ~/get-pip.py \
https://bootstrap.pypa.io/get-pip.py && \
python3.6 ~/get-pip.py && \
ln -s /usr/bin/python3.6 /usr/local/bin/python3 && \
ln -s /usr/bin/python3.6 /usr/local/bin/python && \
$PIP_INSTALL \
setuptools \
&& \
$PIP_INSTALL \
numpy \
sox \
tqdm && \
# ==================================================================
# libsndfile https://github.com/erikd/libsndfile.git
# ------------------------------------------------------------------
cd /tmp && git clone https://github.com/erikd/libsndfile.git && \
cd libsndfile && git checkout 4bdd7414602946a18799b514001b0570e8693a47 && \
./autogen.sh && ./configure --enable-werror && \
make && make check && make install && \
# ==================================================================
# KenLM https://github.com/kpu/kenlm
# ------------------------------------------------------------------
cd /root && git clone https://github.com/kpu/kenlm.git && \
cd kenlm && git checkout e47088ddfae810a5ee4c8a9923b5f8071bed1ae8 && \
mkdir build && cd build && \
cmake .. -DCMAKE_POSITION_INDEPENDENT_CODE=ON && \
make -j$(nproc) && make install && \
# ==================================================================
# config & cleanup
# ------------------------------------------------------------------
ldconfig && \
apt-get clean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/* /tmp/*