Dockerfile.min 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # You need to build wheels before building this image. Please consult
  2. # docker-devel/README.txt.
  3. # This is the base of the openjdk image.
  4. #
  5. # It might be more efficient to use a minimal distribution, like Alpine. But
  6. # the upside of this being popular is that people might already have it.
  7. FROM buildpack-deps:jessie-curl
  8. ENV SYNTAXNETDIR=/opt/tensorflow PATH=$PATH:/root/bin
  9. RUN apt-get update \
  10. && apt-get install -y \
  11. file \
  12. git \
  13. graphviz \
  14. libcurl3 \
  15. libfreetype6 \
  16. libgraphviz-dev \
  17. liblapack3 \
  18. libopenblas-base \
  19. libpng12-0 \
  20. libxft2 \
  21. python-dev \
  22. python-mock \
  23. python-pip \
  24. python2.7 \
  25. zlib1g-dev \
  26. && apt-get clean \
  27. && (rm -f /var/cache/apt/archives/*.deb \
  28. /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true)
  29. # Install common Python dependencies. Similar to above, remove caches
  30. # afterwards to help keep Docker images smaller.
  31. RUN pip install --ignore-installed pip \
  32. && python -m pip install numpy \
  33. && rm -rf /root/.cache/pip /tmp/pip*
  34. RUN python -m pip install \
  35. asciitree \
  36. ipykernel \
  37. jupyter \
  38. matplotlib \
  39. pandas \
  40. protobuf \
  41. scipy \
  42. sklearn \
  43. && python -m ipykernel.kernelspec \
  44. && python -m pip install pygraphviz \
  45. --install-option="--include-path=/usr/include/graphviz" \
  46. --install-option="--library-path=/usr/lib/graphviz/" \
  47. && rm -rf /root/.cache/pip /tmp/pip*
  48. COPY syntaxnet_with_tensorflow-0.2-cp27-none-linux_x86_64.whl $SYNTAXNETDIR/
  49. RUN python -m pip install \
  50. $SYNTAXNETDIR/syntaxnet_with_tensorflow-0.2-cp27-none-linux_x86_64.whl \
  51. && rm -rf /root/.cache/pip /tmp/pip*
  52. # This makes the IP exposed actually "*"; we'll do host restrictions by passing
  53. # a hostname to the `docker run` command.
  54. COPY tensorflow/tensorflow/tools/docker/jupyter_notebook_config.py /root/.jupyter/
  55. EXPOSE 8888
  56. # This does not need to be compiled, only copied.
  57. COPY examples $SYNTAXNETDIR/syntaxnet/examples
  58. # For some reason, this works if we run it in a bash shell :/ :/ :/
  59. CMD /bin/bash -c "python -m jupyter_core.command notebook --debug --notebook-dir=/opt/tensorflow/syntaxnet/examples"