Skip to content

Instantly share code, notes, and snippets.

@tianon
Last active December 29, 2015 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tianon/7666936 to your computer and use it in GitHub Desktop.
Save tianon/7666936 to your computer and use it in GitHub Desktop.
pyenv in tianon/centos-null:5.9
FROM tianon/centos-null:5.9
RUN yum install -y wget
RUN wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm && rpm -Uvh epel-release-5-4.noarch.rpm && rm epel-release-5-4.noarch.rpm
RUN yum install -y git
RUN git clone https://github.com/yyuu/pyenv.git /.pyenv
ENV PYENV_ROOT /.pyenv
ENV PATH /.pyenv/bin:$PATH
# for compiling python and friends
RUN yum install -y gcc patch make readline-devel zlib-devel bzip2-devel sqlite-devel openssl-devel
RUN echo '#!/bin/sh' > /.pyinit && echo 'eval "$(pyenv init -)" && exec "$@"' >> /.pyinit && chmod +x /.pyinit
ENTRYPOINT ["/.pyinit"]
RUN /.pyinit pyenv install 2.7
ENV PYENV_VERSION 2.7
RUN /.pyinit pip install --egg scons
# as a final example to show again how to do more complex chains
RUN /.pyinit sh -c 'echo hello && echo test && env'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment