compile_snowboy_python35.dockerfile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # build last version
  2. # docker build --force-rm=true -t compile_snowboy_python35 -f compile_snowboy_python35.dockerfile .
  3. # build specified version
  4. # docker build --force-rm=true --build-arg SNOWBOY_VERSION=1.1.1 -t compile_snowboy_python35 -f compile_snowboy_python35.dockerfile .
  5. # compile into local /tmp/snowboy
  6. # docker run -it --rm -v /tmp/snowboy:/data compile_snowboy_python35
  7. FROM python:3.5-jessie
  8. ARG SNOWBOY_VERSION="1.3.0"
  9. RUN apt-get update
  10. RUN apt-get install -y git make g++ python3-dev libatlas3-base libblas-dev gfortran vim wget libpcre3-dev libtool libatlas-base-dev
  11. # get the last version of swig
  12. RUN wget https://downloads.sourceforge.net/swig/swig-3.0.12.tar.gz && tar xzf swig-3.0.12.tar.gz
  13. RUN cd swig-3.0.12 && \
  14. ./configure --prefix=/usr \
  15. --without-clisp \
  16. --without-maximum-compile-warnings && \
  17. make
  18. RUN cd swig-3.0.12 && \
  19. make install && \
  20. install -v -m755 -d /usr/share/doc/swig-3.0.12 && \
  21. cp -v -R Doc/* /usr/share/doc/swig-3.0.12
  22. RUN wget https://github.com/Kitt-AI/snowboy/archive/v${SNOWBOY_VERSION}.tar.gz && tar xzf v${SNOWBOY_VERSION}.tar.gz
  23. RUN cd /snowboy-${SNOWBOY_VERSION}/swig/Python3 && make
  24. RUN cd /snowboy-${SNOWBOY_VERSION}/swig/Python3 && python3 -c "import _snowboydetect; print('OK')"
  25. # compiled binary will be placed into data folder
  26. RUN mkdir /data
  27. CMD cp /snowboy-*/swig/Python3/*.so /data