Skip to content

Instantly share code, notes, and snippets.

@miticojo
Last active December 4, 2016 07:24
Show Gist options
  • Save miticojo/814432c06f6b029ff98249aa21d079b6 to your computer and use it in GitHub Desktop.
Save miticojo/814432c06f6b029ff98249aa21d079b6 to your computer and use it in GitHub Desktop.
Centos 7 with Python 3.5.2 and virtualenv
MAINTAINER miticojo[AT]gmail.com
FROM centos:7
# set python version to install
ARG PYTHON_VER=3.5.2
ENV PYTHON_URL=https://www.python.org/ftp/python/$PYTHON_VER/Python-$PYTHON_VER.tgz
# install minimum requirements to compile, run compilation, install pip and virtualenv, finally clean used files
RUN yum install -y gcc make openssl-devel\
&& curl $PYTHON_URL | tar -xzf - -C /usr/src/ \
&& cd /usr/src/Python-$PYTHON_VER \
&& ./configure && make install \
&& curl "https://bootstrap.pypa.io/get-pip.py" | python \
&& pip install virtualenv \
&& rm -rf /var/cache/apk/* && rm -rf /usr/src/Python-*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment