Created
June 27, 2021 03:16
-
-
Save cjjavellana/0b0bf0c3db5f2436a1119330cde85249 to your computer and use it in GitHub Desktop.
Compile Python From Source for centos / rhel / fedora
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM centos:latest | |
USER root | |
# We separate update as this step takes too long | |
RUN yum -y update | |
RUN yum -y groupinstall "Development Tools" && \ | |
yum -y install gcc openssl-devel bzip2-devel libffi-devel && \ | |
yum -y install wget | |
ENV PATH="/apps/Python-3.9.5/bin:${PATH}" | |
RUN mkdir /apps && \ | |
cd /tmp && \ | |
wget https://www.python.org/ftp/python/3.9.5/Python-3.9.5.tgz && \ | |
tar xzvf Python-3.9.5.tgz && \ | |
cd /tmp/Python-3.9.5 && \ | |
./configure --enable-optimizations --with-ensurepip=install --prefix=/apps/Python-3.9.5 && \ | |
make && \ | |
make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment