Dockerfile 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. FROM java:8
  2. ENV SYNTAXNETDIR=/opt/tensorflow PATH=$PATH:/root/bin
  3. RUN mkdir -p $SYNTAXNETDIR \
  4. && cd $SYNTAXNETDIR \
  5. && apt-get update \
  6. && apt-get install git zlib1g-dev file swig python2.7 python-dev python-pip python-mock -y \
  7. && pip install --upgrade pip \
  8. && pip install -U protobuf==3.0.0b2 \
  9. && pip install asciitree \
  10. && pip install numpy \
  11. && wget https://github.com/bazelbuild/bazel/releases/download/0.4.3/bazel-0.4.3-installer-linux-x86_64.sh \
  12. && chmod +x bazel-0.4.3-installer-linux-x86_64.sh \
  13. && ./bazel-0.4.3-installer-linux-x86_64.sh --user \
  14. && git clone --recursive https://github.com/tensorflow/models.git \
  15. && cd $SYNTAXNETDIR/models/syntaxnet/tensorflow \
  16. && echo -e "\n\n\n\n\n\n\n\n\n" | ./configure \
  17. && apt-get autoremove -y \
  18. && apt-get clean
  19. RUN cd $SYNTAXNETDIR/models/syntaxnet \
  20. && bazel test --genrule_strategy=standalone syntaxnet/... util/utf8/...
  21. WORKDIR $SYNTAXNETDIR/models/syntaxnet
  22. CMD [ "sh", "-c", "echo 'Bob brought the pizza to Alice.' | syntaxnet/demo.sh" ]
  23. # COMMANDS to build and run
  24. # ===============================
  25. # mkdir build && cp Dockerfile build/ && cd build
  26. # docker build -t syntaxnet .
  27. # docker run syntaxnet