Dockerfile 1.2 KB
Newer Older
1
2
3
4
5
6
7
FROM java:8

ENV SYNTAXNETDIR=/opt/tensorflow PATH=$PATH:/root/bin

RUN mkdir -p $SYNTAXNETDIR \
    && cd $SYNTAXNETDIR \
    && apt-get update \
8
    && apt-get install git zlib1g-dev file swig python2.7 python-dev python-pip python-mock -y \
9
    && pip install --upgrade pip \
10
    && pip install -U protobuf==3.0.0b2 \
11
12
    && pip install asciitree \
    && pip install numpy \
13
14
15
    && wget https://github.com/bazelbuild/bazel/releases/download/0.4.3/bazel-0.4.3-installer-linux-x86_64.sh \
    && chmod +x bazel-0.4.3-installer-linux-x86_64.sh \
    && ./bazel-0.4.3-installer-linux-x86_64.sh --user \
16
17
    && git clone --recursive https://github.com/tensorflow/models.git \
    && cd $SYNTAXNETDIR/models/syntaxnet/tensorflow \
18
    && echo -e "\n\n\n\n\n\n" | ./configure \
19
20
21
    && apt-get autoremove -y \
    && apt-get clean

22
23
24
RUN cd $SYNTAXNETDIR/models/syntaxnet \
    && bazel test --genrule_strategy=standalone syntaxnet/... util/utf8/...

25
26
27
28
29
30
31
32
33
WORKDIR $SYNTAXNETDIR/models/syntaxnet

CMD [ "sh", "-c", "echo 'Bob brought the pizza to Alice.' | syntaxnet/demo.sh" ]

# COMMANDS to build and run
# ===============================
# mkdir build && cp Dockerfile build/ && cd build
# docker build -t syntaxnet .
# docker run syntaxnet