-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
65 lines (54 loc) · 1.93 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
57
58
59
60
61
62
63
64
65
FROM ubuntu:22.04
LABEL MAINTAINER="Wes Widner <[email protected]>"
# GPU_PLATFORM is the location where model processing takes place. cpu or cuda
ARG GPU_PLATFORM=cpu
ARG DEEPSPEECH_VERSION=0.9.3
ARG GOLANG_VERSION=1.18.7
ENV CGO_ENABLED=1 CGO_CPPFLAGS="-I/usr/include"
ENV GOPATH=/go
ENV PATH=/go/bin:/usr/local/go/bin:/deepspeech:$PATH
ENV CGO_LDFLAGS="-L/deepspeech"
ENV CGO_CXXFLAGS="-I/deepspeech"
ENV LD_LIBRARY_PATH=/deepspeech:$LD_LIBRARY_PATH
ENV DEBIAN_FRONTEND=noninteractive
COPY . /go/src/github.com/kai5263499/diy-jarvis
WORKDIR /go/src/github.com/kai5263499/diy-jarvis
RUN apt-get update && \
apt-get install -y \
git \
curl \
unzip \
wget \
sox \
ffmpeg \
python3-pip \
alsa-utils \
pulseaudio \
pulseaudio-utils \
libsoxr-dev \
tzdata \
portaudio19-dev \
libczmq4 \
libczmq-dev \
libsodium-dev
RUN echo "Install golang" && \
curl -sLO https://dl.google.com/go/go${GOLANG_VERSION}.linux-amd64.tar.gz && \
tar -xf go${GOLANG_VERSION}.linux-amd64.tar.gz && \
mv go /usr/local && \
rm -rf go${GOLANG_VERSION}.linux-amd64.tar.gz
RUN echo "Install deepspeech" && \
mkdir -p /deepspeech && \
cd /deepspeech && \
wget https://github.com/mozilla/DeepSpeech/raw/v${DEEPSPEECH_VERSION}/native_client/deepspeech.h && \
wget https://github.com/mozilla/DeepSpeech/releases/download/v${DEEPSPEECH_VERSION}/native_client.amd64.${GPU_PLATFORM}.linux.tar.xz && \
tar -xvf native_client.amd64.${GPU_PLATFORM}.linux.tar.xz && \
rm native_client.amd64.${GPU_PLATFORM}.linux.tar.xz
RUN echo "Caching golang modules" && \
go mod vendor
RUN echo "Install protoc tools" && \
go get -u github.com/golang/protobuf/protoc-gen-go && \
curl -sLO https://github.com/google/protobuf/releases/download/v3.7.1/protoc-3.7.1-linux-x86_64.zip && \
unzip protoc-3.7.1-linux-x86_64.zip -d protoc3 && \
mv protoc3/bin/* /usr/local/bin/ && \
mv protoc3/include/* /usr/local/include/ && \
rm -rf protoc3 protoc-3.7.1-linux-x86_64.zip