Dockerfile 2.3 KB

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