Skip to content

Instantly share code, notes, and snippets.

@ernado
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save ernado/9305054 to your computer and use it in GitHub Desktop.

Select an option

Save ernado/9305054 to your computer and use it in GitHub Desktop.
Dockefile for pypy python inerpreter, easy_install and pip. And dockerfile for nginx. How to use docker with pypy:
# http://nginx.org/download/nginx-1.5.10.tar.gz
FROM ubuntu:raring
MAINTAINER Alexandr Razumov [email protected]
# base for nginx spdy
RUN sed -i 's/archive.ubuntu.com/mirror.yandex.ru/g' /etc/apt/sources.list
RUN apt-get update
RUN apt-get install wget make build-essential zlib1g-dev libpcre3 libpcre3-dev libbz2-dev libssl-dev -y
ENV NGINX_VER 1.5.10
RUN wget http://nginx.org/download/nginx-$NGINX_VER.tar.gz -nv
RUN tar -xf nginx-$NGINX_VER.tar.gz
RUN cd nginx-$NGINX_VER && ./configure --with-http_spdy_module && make -j8 -s && make install
ENTRYPOINT ["/usr/local/nginx/sbin/nginx"]
FROM ubuntu:raring
MAINTAINER Alexandr Razumov [email protected]
# base for pypy projects
# Python 2.7.3 (87aa9de10f9ca71da9ab4a3d53e0ba176b67d086, Mar 02 2014, 07:55:35)
# [PyPy 2.2.1 with GCC 4.7.3] on linux2
# pypy wth pip and git
# using yandex mirrors for apt
RUN sed -i 's/archive.ubuntu.com/mirror.yandex.ru/g' /etc/apt/sources.list
RUN apt-get update
# installing dependencies for pypy compilation
RUN apt-get install git ca-certificates python wget gcc make python-dev libffi-dev libsqlite3-dev pkg-config libz-dev libbz2-dev libncurses-dev libexpat1-dev libssl-dev libgc-dev python-sphinx python-greenlet -y -q
# downloading & extracting pypy
RUN wget https://bitbucket.org/pypy/pypy/downloads/pypy-2.2.1-src.tar.bz2 --no-check-certificate -nv
RUN tar -xf pypy-2.2.1-src.tar.bz2
RUN rm pypy-2.2.1-src.tar.bz2
# compiling pypy
# WARNING: may take some time (~1.5 hours or even more), so use it from cache until new pypy version
RUN cd pypy-2.2.1-src/pypy/goal && python ../../rpython/bin/rpython --opt=jit targetpypystandalone.py
# replacing python by pypy
RUN rm /usr/bin/python && ln -s /pypy-2.2.1-src/pypy/goal/pypy-c /usr/bin/python
# modifying PATH variable
ENV PATH /pypy-2.2.1-src/bin:$PATH
# easy_install
RUN wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -nv
RUN python ez_setup.py
RUN easy_install pip
ENTRYPOINT ["python"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment