Dockerfile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. FROM debian:wheezy
  2. RUN set -ex; \
  3. apt-get update -qq; \
  4. apt-get install -y \
  5. gcc \
  6. make \
  7. zlib1g \
  8. zlib1g-dev \
  9. libssl-dev \
  10. git \
  11. apt-transport-https \
  12. ca-certificates \
  13. curl \
  14. lxc \
  15. iptables \
  16. libsqlite3-dev \
  17. ; \
  18. rm -rf /var/lib/apt/lists/*
  19. # Build Python 2.7.9 from source
  20. RUN set -ex; \
  21. curl -LO https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz; \
  22. tar -xzf Python-2.7.9.tgz; \
  23. cd Python-2.7.9; \
  24. ./configure --enable-shared; \
  25. make; \
  26. make install; \
  27. cd ..; \
  28. rm -rf /Python-2.7.9; \
  29. rm Python-2.7.9.tgz
  30. # Make libpython findable
  31. ENV LD_LIBRARY_PATH /usr/local/lib
  32. # Install setuptools
  33. RUN set -ex; \
  34. curl -LO https://bootstrap.pypa.io/ez_setup.py; \
  35. python ez_setup.py; \
  36. rm ez_setup.py
  37. # Install pip
  38. RUN set -ex; \
  39. curl -LO https://pypi.python.org/packages/source/p/pip/pip-7.0.1.tar.gz; \
  40. tar -xzf pip-7.0.1.tar.gz; \
  41. cd pip-7.0.1; \
  42. python setup.py install; \
  43. cd ..; \
  44. rm -rf pip-7.0.1; \
  45. rm pip-7.0.1.tar.gz
  46. ENV ALL_DOCKER_VERSIONS 1.7.1 1.8.1
  47. RUN set -ex; \
  48. curl https://get.docker.com/builds/Linux/x86_64/docker-1.7.1 -o /usr/local/bin/docker-1.7.1; \
  49. chmod +x /usr/local/bin/docker-1.7.1; \
  50. curl https://get.docker.com/builds/Linux/x86_64/docker-1.8.1 -o /usr/local/bin/docker-1.8.1; \
  51. chmod +x /usr/local/bin/docker-1.8.1
  52. # Set the default Docker to be run
  53. RUN ln -s /usr/local/bin/docker-1.7.1 /usr/local/bin/docker
  54. RUN useradd -d /home/user -m -s /bin/bash user
  55. WORKDIR /code/
  56. ADD requirements.txt /code/
  57. RUN pip install -r requirements.txt
  58. ADD requirements-dev.txt /code/
  59. RUN pip install -r requirements-dev.txt
  60. RUN pip install tox==2.1.1
  61. ADD . /code/
  62. RUN python setup.py install
  63. RUN chown -R user /code/
  64. ENTRYPOINT ["/usr/local/bin/docker-compose"]