Dockerfile 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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-1.8.3 \
  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 -L https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz | tar -xz; \
  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. # Build python 3.4 from source
  30. RUN set -ex; \
  31. curl -L https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tgz | tar -xz; \
  32. cd Python-3.4.3; \
  33. ./configure --enable-shared; \
  34. make; \
  35. make install; \
  36. cd ..; \
  37. rm -rf /Python-3.4.3
  38. # Make libpython findable
  39. ENV LD_LIBRARY_PATH /usr/local/lib
  40. # Install setuptools
  41. RUN set -ex; \
  42. curl -L https://bootstrap.pypa.io/ez_setup.py | python
  43. # Install pip
  44. RUN set -ex; \
  45. curl -L https://pypi.python.org/packages/source/p/pip/pip-8.1.1.tar.gz | tar -xz; \
  46. cd pip-8.1.1; \
  47. python setup.py install; \
  48. cd ..; \
  49. rm -rf pip-8.1.1
  50. # Python3 requires a valid locale
  51. RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen
  52. ENV LANG en_US.UTF-8
  53. RUN useradd -d /home/user -m -s /bin/bash user
  54. WORKDIR /code/
  55. RUN pip install tox==2.1.1
  56. ADD requirements.txt /code/
  57. ADD requirements-dev.txt /code/
  58. ADD .pre-commit-config.yaml /code/
  59. ADD setup.py /code/
  60. ADD tox.ini /code/
  61. ADD compose /code/compose/
  62. RUN tox --notest
  63. ADD . /code/
  64. RUN chown -R user /code/
  65. ENTRYPOINT ["/code/.tox/py27/bin/docker-compose"]