-
Notifications
You must be signed in to change notification settings - Fork 290
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (42 loc) · 2.31 KB
/
Dockerfile
File metadata and controls
45 lines (42 loc) · 2.31 KB
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
FROM ubuntu:18.04
ENV GOPATH /root
ENV PROTOBUF_VERSION 3.5.1
COPY . /root/src/gopkg.in/src-d/hercules.v7
RUN apt-get update && \
apt-get install -y --no-install-suggests --no-install-recommends software-properties-common && \
add-apt-repository -y ppa:gophers/archive && \
apt-get update && \
apt-get install -y --no-install-suggests --no-install-recommends locales golang-1.10-go python3 python3-dev python3-distutils libyaml-dev libyaml-0-2 libxml2-dev libxml2 curl git make unzip g++ && \
curl -SLo protoc.zip https://github.com/google/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-linux-x86_64.zip && \
unzip -d /usr/local protoc.zip && rm protoc.zip && \
locale-gen en_US.UTF-8 && \
export PATH=/usr/lib/go-1.10/bin:/root/bin:$PATH && \
go get -v github.com/golang/dep/cmd/dep && \
cd /root/src/gopkg.in/src-d/hercules.v7 && \
export CGO_CXXFLAGS=-std=c++14 && \
curl -L "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-$(go env GOOS)-x86_64-1.7.0.tar.gz" | tar -C /usr/local -xz && \
make && \
rm /usr/local/bin/protoc && rm /usr/local/readme.txt && rm -rf /usr/local/include/google && \
cp /root/bin/hercules /usr/local/bin && \
cp -r /root/src/gopkg.in/src-d/hercules.v7/*.py /root/src/gopkg.in/src-d/hercules.v7/internal /usr/local/bin && \
sed -i 's/parser.add_argument("--backend",/parser.add_argument("--backend", default="Agg",/' /usr/local/bin/labours.py && \
echo '#!/bin/bash\n\
\n\
echo\n\
echo " $@"\n\
echo\n\' > /browser && \
chmod +x /browser && \
curl https://bootstrap.pypa.io/get-pip.py | python3 - pip==18.1 && \
pip3 install --no-cache-dir --no-build-isolation cython && \
pip3 install --no-cache-dir --no-build-isolation -r /root/src/gopkg.in/src-d/hercules.v7/requirements.txt https://github.com/mind/wheels/releases/download/tf1.7-cpu/tensorflow-1.7.0-cp36-cp36m-linux_x86_64.whl && \
rm -rf /root/* && \
apt-get remove -y software-properties-common golang-1.10-go python3-dev libyaml-dev libxml2-dev curl git make unzip g++ && \
apt-get remove -y *-doc *-man && \
rm -rf /usr/share/doc /usr/share/man && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean
EXPOSE 8000
ENV BROWSER /browser
ENV LC_ALL en_US.UTF-8
ENV COUPLES_SERVER_TIME 7200