Dockerfile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. FROM ubuntu:16.04
  2. ENV GOPATH /root
  3. RUN apt-get update && \
  4. apt-get install -y --no-install-suggests --no-install-recommends software-properties-common && \
  5. add-apt-repository -y ppa:gophers/archive && \
  6. apt-get update && \
  7. apt-get install -y --no-install-suggests --no-install-recommends locales golang-1.9-go python3 python3-dev libyaml-dev libyaml-0-2 libxml2-dev libxml2 curl git make unzip g++-5 && \
  8. update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 90 && \
  9. update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 90 && \
  10. curl -SLo protoc.zip https://github.com/google/protobuf/releases/download/v3.5.0/protoc-3.5.0-linux-x86_64.zip && \
  11. unzip -d /usr/local protoc.zip && rm protoc.zip && \
  12. locale-gen en_US.UTF-8 && \
  13. export PATH=/usr/lib/go-1.9/bin:$PATH && \
  14. go get -v -d gopkg.in/src-d/hercules.v3/... && \
  15. cd /root/src/gopkg.in/src-d/hercules.v3 && \
  16. export CGO_CXXFLAGS=-std=c++14 && \
  17. make && \
  18. rm /usr/local/bin/protoc && rm /usr/local/readme.txt && rm -rf /usr/local/include/google && \
  19. cp /root/bin/hercules /usr/local/bin && \
  20. cp -r /root/src/gopkg.in/src-d/hercules.v3/*.py /root/src/gopkg.in/src-d/hercules.v3/pb /usr/local/bin && \
  21. sed -i 's/parser.add_argument("--backend",/parser.add_argument("--backend", default="Agg",/' /usr/local/bin/labours.py && \
  22. echo '#!/bin/bash\n\
  23. \n\
  24. echo\n\
  25. echo " $@"\n\
  26. echo\n\' > /browser && \
  27. chmod +x /browser && \
  28. curl https://bootstrap.pypa.io/get-pip.py | python3 && \
  29. pip3 install --no-cache-dir -r /root/src/gopkg.in/src-d/hercules.v3/requirements.txt https://github.com/mind/wheels/releases/download/tf1.3-cpu/tensorflow-1.3.0-cp35-cp35m-linux_x86_64.whl && \
  30. rm -rf /root/* && \
  31. apt-get remove -y software-properties-common golang-1.9-go python3-dev libyaml-dev libxml2-dev curl git make unzip g++-5 && \
  32. apt-get remove -y *-doc *-man && \
  33. apt-get autoremove -y && \
  34. rm -rf /var/lib/apt/lists/* && \
  35. apt-get clean
  36. EXPOSE 8000
  37. ENV BROWSER /browser
  38. ENV LC_ALL en_US.UTF-8
  39. ENV COUPLES_SERVER_TIME 7200