-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
db30007
commit e547dc2
Showing
4 changed files
with
68 additions
and
115 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,8 @@ | ||
FROM kubespheredev/builder-base:v3.1.0 | ||
FROM registry.cn-huhehaote.aliyuncs.com/ydong/builder-base:v4.1.0 | ||
|
||
# python3 | ||
ENV PYTHON_VERSION=3.7.11 | ||
RUN yum -y install bzip2-devel libffi-devel libsqlite3x-devel && \ | ||
curl -fSL https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz -o /usr/src/Python-${PYTHON_VERSION}.tgz && \ | ||
tar xzf /usr/src/Python-${PYTHON_VERSION}.tgz -C /usr/src/ --no-same-owner && \ | ||
cd /usr/src/Python-${PYTHON_VERSION} && \ | ||
./configure --enable-optimizations --with-ensurepip=install --enable-loadable-sqlite-extensions && \ | ||
make altinstall -j 2 && \ | ||
cd ../ && \ | ||
rm -rf /usr/src/Python-${PYTHON_VERSION}.tgz /usr/src/Python-${PYTHON_VERSION} && \ | ||
ln -fs /usr/local/bin/python3.7 /usr/bin/python && \ | ||
ln -fs /usr/local/bin/python3.7 /usr/bin/python3 && \ | ||
ln -fs /usr/local/bin/pip3.7 /usr/bin/pip && \ | ||
python3 -m pip install --upgrade pip && \ | ||
sed -e 's|^#!/usr/bin/python|#!/usr/bin/python2.7|g' -i.bak /usr/bin/yum && \ | ||
sed -e 's|^#! /usr/bin/python|#! /usr/bin/python2.7|g' -i.bak /usr/libexec/urlgrabber-ext-down && \ | ||
yum -y remove bzip2-devel libffi-devel libsqlite3x-devel && \ | ||
yum -y clean all | ||
# python:2.7.18 pip:20.3.4 | ||
RUN apt-get install -y python2 && apt-get clean autoclean && ln -s /usr/bin/python2 /usr/bin/python | ||
|
||
RUN wget https://bootstrap.pypa.io/pip/2.7/get-pip.py && python get-pip.py && rm get-pip.py | ||
|
||
CMD ["python","--version"] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,9 @@ | ||
FROM kubespheredev/builder-base:v3.1.0-podman | ||
FROM registry.cn-huhehaote.aliyuncs.com/ydong/builder-base:v4.1.0-podman | ||
|
||
# python3 | ||
ENV PYTHON_VERSION=3.7.11 | ||
RUN yum -y install bzip2-devel libffi-devel libsqlite3x-devel && \ | ||
curl -fSL https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz -o /usr/src/Python-${PYTHON_VERSION}.tgz && \ | ||
tar xzf /usr/src/Python-${PYTHON_VERSION}.tgz -C /usr/src/ --no-same-owner && \ | ||
cd /usr/src/Python-${PYTHON_VERSION} && \ | ||
./configure --enable-optimizations --with-ensurepip=install --enable-loadable-sqlite-extensions && \ | ||
make altinstall -j 2 && \ | ||
cd ../ && \ | ||
rm -rf /usr/src/Python-${PYTHON_VERSION}.tgz /usr/src/Python-${PYTHON_VERSION} && \ | ||
ln -fs /usr/local/bin/python3.7 /usr/bin/python && \ | ||
ln -fs /usr/local/bin/python3.7 /usr/bin/python3 && \ | ||
ln -fs /usr/local/bin/pip3.7 /usr/bin/pip && \ | ||
python3 -m pip install --upgrade pip && \ | ||
sed -e 's|^#!/usr/bin/python|#!/usr/bin/python2.7|g' -i.bak /usr/bin/yum && \ | ||
sed -e 's|^#! /usr/bin/python|#! /usr/bin/python2.7|g' -i.bak /usr/libexec/urlgrabber-ext-down && \ | ||
yum -y remove bzip2-devel libffi-devel libsqlite3x-devel && \ | ||
yum -y clean all | ||
# python:2.7.18 pip:20.3.4 | ||
RUN apt-get install -y python2 && apt-get clean autoclean && ln -s /usr/bin/python2 /usr/bin/python | ||
|
||
RUN wget https://bootstrap.pypa.io/pip/2.7/get-pip.py && python get-pip.py && rm get-pip.py | ||
ENV PATH $PATH:/usr/local/bin | ||
|
||
CMD ["python","--version"] |