Dockerfile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. ca-certificates \
  13. curl \
  14. libsqlite3-dev \
  15. ; \
  16. rm -rf /var/lib/apt/lists/*
  17. RUN curl https://get.docker.com/builds/Linux/x86_64/docker-latest \
  18. -o /usr/local/bin/docker && \
  19. chmod +x /usr/local/bin/docker
  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. RUN useradd -d /home/user -m -s /bin/bash user
  62. WORKDIR /code/
  63. RUN pip install tox==2.1.1
  64. ADD requirements.txt /code/
  65. ADD requirements-dev.txt /code/
  66. ADD .pre-commit-config.yaml /code/
  67. ADD setup.py /code/
  68. ADD tox.ini /code/
  69. ADD compose /code/compose/
  70. RUN tox --notest
  71. ADD . /code/
  72. RUN chown -R user /code/
  73. ENTRYPOINT ["/code/.tox/py27/bin/docker-compose"]