Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Setting up pyenv in docker
FROM tianon/centos-null:5.9
RUN rpm -i
RUN yum -y update
RUN yum -y install gcc git curl make zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl openssl-devel
RUN useradd -m python_user
RUN ln -s /proc/self/fd /dev/fd
WORKDIR /home/python_user
USER python_user
RUN git clone git:// .pyenv
ENV HOME /home/python_user
RUN pyenv install 2.7.6
RUN pyenv global 2.7.6
RUN pyenv rehash
RUN pip install --egg scons
# Do whatever extra install things you need here...
ADD /home/python_user/
ENTRYPOINT ["python"]
CMD [""]
# build with something like
# docker build -t python-demo .
# to see current python version by running
# docker run python-demo
# To run anything else
# docker run python-demo /path/to/python/file
#!/usr/bin/env python
import platform
import os
print platform.platform()
print platform.python_version()
print os.getuid()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment