diff --git a/Others/python/3.10.17/22.03-lts/Dockerfile b/Others/python/3.10.17/22.03-lts/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..66260999edf242292181e8cbc415d10635c96844 --- /dev/null +++ b/Others/python/3.10.17/22.03-lts/Dockerfile @@ -0,0 +1,63 @@ +ARG BASE=openeuler/openeuler:22.03-lts +ARG VERSION=3.10.17 + +FROM ${BASE} as builder + +ARG VERSION +ARG TARGETARCH + +# Install dependencies +RUN yum update -y && \ + yum install -y \ + gcc \ + gcc-c++ \ + make \ + cmake \ + curl \ + zlib-devel \ + bzip2-devel \ + openssl-devel \ + ncurses-devel \ + sqlite-devel \ + readline-devel \ + tk-devel \ + gdbm-devel \ + libpcap-devel \ + xz-devel \ + libev-devel \ + expat-devel \ + libffi-devel \ + systemtap-sdt-devel && \ + yum clean all && \ + rm -rf /var/cache/yum && \ + rm -rf /tmp/* + +RUN PY_HOME=/usr/local/python${VERSION} && \ + PY_INSTALLER_DIR=Python-${VERSION} && \ + PY_INSTALLER_TGZ=Python-${VERSION}.tgz && \ + curl -fsSL -o "/tmp/${PY_INSTALLER_TGZ}" "https://repo.huaweicloud.com/python/${VERSION}/${PY_INSTALLER_TGZ}" && \ + tar -xf /tmp/${PY_INSTALLER_TGZ} -C /tmp && \ + cd /tmp/${PY_INSTALLER_DIR} && \ + mkdir -p /${PY_HOME}/lib && \ + ./configure --prefix=${PY_HOME} --enable-shared LDFLAGS="-Wl,-rpath ${PY_HOME}/lib" && \ + make -j "$(nproc)" && \ + make altinstall && \ + rm -rf /tmp/* + +FROM ${BASE} AS official + +ARG VERSION + +COPY --from=builder /usr/local/python${VERSION} /usr/local/python${VERSION} + +RUN VERSION_SHORT=$(echo "${VERSION}" | cut -d. -f1,2) && \ + VERSION_MAJOR=$(echo "${VERSION}" | cut -d. -f1) && \ + PY_HOME=/usr/local/python${VERSION} && \ + ln -sf ${PY_HOME}/bin/python${VERSION_SHORT} ${PY_HOME}/bin/python${VERSION_MAJOR} && \ + ln -sf ${PY_HOME}/bin/pip${VERSION_SHORT} ${PY_HOME}/bin/pip${VERSION_MAJOR} && \ + ln -sf ${PY_HOME}/bin/python${VERSION_MAJOR} ${PY_HOME}/bin/python && \ + ln -sf ${PY_HOME}/bin/pip${VERSION_MAJOR} ${PY_HOME}/bin/pip + +RUN echo "${VERSION}" > /test.txt + +ENV PATH=/usr/local/python${VERSION}/bin:${PATH} \ No newline at end of file diff --git a/Others/python/3.11.13/22.03-lts/Dockerfile b/Others/python/3.11.13/22.03-lts/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..1cb5b67ea7b5e6991a2e252da500b0a3ac7b3c90 --- /dev/null +++ b/Others/python/3.11.13/22.03-lts/Dockerfile @@ -0,0 +1,63 @@ +ARG BASE=openeuler/openeuler:22.03-lts +ARG VERSION=3.11.13 + +FROM ${BASE} as builder + +ARG VERSION +ARG TARGETARCH + +# Install dependencies +RUN yum update -y && \ + yum install -y \ + gcc \ + gcc-c++ \ + make \ + cmake \ + curl \ + zlib-devel \ + bzip2-devel \ + openssl-devel \ + ncurses-devel \ + sqlite-devel \ + readline-devel \ + tk-devel \ + gdbm-devel \ + libpcap-devel \ + xz-devel \ + libev-devel \ + expat-devel \ + libffi-devel \ + systemtap-sdt-devel && \ + yum clean all && \ + rm -rf /var/cache/yum && \ + rm -rf /tmp/* + +RUN PY_HOME=/usr/local/python${VERSION} && \ + PY_INSTALLER_DIR=Python-${VERSION} && \ + PY_INSTALLER_TGZ=Python-${VERSION}.tgz && \ + curl -fsSL -o "/tmp/${PY_INSTALLER_TGZ}" "https://repo.huaweicloud.com/python/${VERSION}/${PY_INSTALLER_TGZ}" && \ + tar -xf /tmp/${PY_INSTALLER_TGZ} -C /tmp && \ + cd /tmp/${PY_INSTALLER_DIR} && \ + mkdir -p /${PY_HOME}/lib && \ + ./configure --prefix=${PY_HOME} --enable-shared LDFLAGS="-Wl,-rpath ${PY_HOME}/lib" && \ + make -j "$(nproc)" && \ + make altinstall && \ + rm -rf /tmp/* + +FROM ${BASE} AS official + +ARG VERSION + +COPY --from=builder /usr/local/python${VERSION} /usr/local/python${VERSION} + +RUN VERSION_SHORT=$(echo "${VERSION}" | cut -d. -f1,2) && \ + VERSION_MAJOR=$(echo "${VERSION}" | cut -d. -f1) && \ + PY_HOME=/usr/local/python${VERSION} && \ + ln -sf ${PY_HOME}/bin/python${VERSION_SHORT} ${PY_HOME}/bin/python${VERSION_MAJOR} && \ + ln -sf ${PY_HOME}/bin/pip${VERSION_SHORT} ${PY_HOME}/bin/pip${VERSION_MAJOR} && \ + ln -sf ${PY_HOME}/bin/python${VERSION_MAJOR} ${PY_HOME}/bin/python && \ + ln -sf ${PY_HOME}/bin/pip${VERSION_MAJOR} ${PY_HOME}/bin/pip + +RUN echo "${VERSION}" > /test.txt + +ENV PATH=/usr/local/python${VERSION}/bin:${PATH} \ No newline at end of file diff --git a/Others/python/3.11.13/24.03-lts/Dockerfile b/Others/python/3.11.13/24.03-lts/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..584eb7860ba73503f8cd4a551ed9131518527117 --- /dev/null +++ b/Others/python/3.11.13/24.03-lts/Dockerfile @@ -0,0 +1,63 @@ +ARG BASE=openeuler/openeuler:24.03-lts +ARG VERSION=3.11.13 + +FROM ${BASE} as builder + +ARG VERSION +ARG TARGETARCH + +# Install dependencies +RUN yum update -y && \ + yum install -y \ + gcc \ + gcc-c++ \ + make \ + cmake \ + curl \ + zlib-devel \ + bzip2-devel \ + openssl-devel \ + ncurses-devel \ + sqlite-devel \ + readline-devel \ + tk-devel \ + gdbm-devel \ + libpcap-devel \ + xz-devel \ + libev-devel \ + expat-devel \ + libffi-devel \ + systemtap-sdt-devel && \ + yum clean all && \ + rm -rf /var/cache/yum && \ + rm -rf /tmp/* + +RUN PY_HOME=/usr/local/python${VERSION} && \ + PY_INSTALLER_DIR=Python-${VERSION} && \ + PY_INSTALLER_TGZ=Python-${VERSION}.tgz && \ + curl -fsSL -o "/tmp/${PY_INSTALLER_TGZ}" "https://repo.huaweicloud.com/python/${VERSION}/${PY_INSTALLER_TGZ}" && \ + tar -xf /tmp/${PY_INSTALLER_TGZ} -C /tmp && \ + cd /tmp/${PY_INSTALLER_DIR} && \ + mkdir -p /${PY_HOME}/lib && \ + ./configure --prefix=${PY_HOME} --enable-shared LDFLAGS="-Wl,-rpath ${PY_HOME}/lib" && \ + make -j "$(nproc)" && \ + make altinstall && \ + rm -rf /tmp/* + +FROM ${BASE} AS official + +ARG VERSION + +COPY --from=builder /usr/local/python${VERSION} /usr/local/python${VERSION} + +RUN VERSION_SHORT=$(echo "${VERSION}" | cut -d. -f1,2) && \ + VERSION_MAJOR=$(echo "${VERSION}" | cut -d. -f1) && \ + PY_HOME=/usr/local/python${VERSION} && \ + ln -sf ${PY_HOME}/bin/python${VERSION_SHORT} ${PY_HOME}/bin/python${VERSION_MAJOR} && \ + ln -sf ${PY_HOME}/bin/pip${VERSION_SHORT} ${PY_HOME}/bin/pip${VERSION_MAJOR} && \ + ln -sf ${PY_HOME}/bin/python${VERSION_MAJOR} ${PY_HOME}/bin/python && \ + ln -sf ${PY_HOME}/bin/pip${VERSION_MAJOR} ${PY_HOME}/bin/pip + +RUN echo "${VERSION}" > /test.txt + +ENV PATH=/usr/local/python${VERSION}/bin:${PATH} \ No newline at end of file diff --git a/Others/python/3.12.10/22.03-lts/Dockerfile b/Others/python/3.12.10/22.03-lts/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..8697298d297b7721e609a662a20159c4c15b200d --- /dev/null +++ b/Others/python/3.12.10/22.03-lts/Dockerfile @@ -0,0 +1,63 @@ +ARG BASE=openeuler/openeuler:22.03-lts +ARG VERSION=3.12.10 + +FROM ${BASE} as builder + +ARG VERSION +ARG TARGETARCH + +# Install dependencies +RUN yum update -y && \ + yum install -y \ + gcc \ + gcc-c++ \ + make \ + cmake \ + curl \ + zlib-devel \ + bzip2-devel \ + openssl-devel \ + ncurses-devel \ + sqlite-devel \ + readline-devel \ + tk-devel \ + gdbm-devel \ + libpcap-devel \ + xz-devel \ + libev-devel \ + expat-devel \ + libffi-devel \ + systemtap-sdt-devel && \ + yum clean all && \ + rm -rf /var/cache/yum && \ + rm -rf /tmp/* + +RUN PY_HOME=/usr/local/python${VERSION} && \ + PY_INSTALLER_DIR=Python-${VERSION} && \ + PY_INSTALLER_TGZ=Python-${VERSION}.tgz && \ + curl -fsSL -o "/tmp/${PY_INSTALLER_TGZ}" "https://repo.huaweicloud.com/python/${VERSION}/${PY_INSTALLER_TGZ}" && \ + tar -xf /tmp/${PY_INSTALLER_TGZ} -C /tmp && \ + cd /tmp/${PY_INSTALLER_DIR} && \ + mkdir -p /${PY_HOME}/lib && \ + ./configure --prefix=${PY_HOME} --enable-shared LDFLAGS="-Wl,-rpath ${PY_HOME}/lib" && \ + make -j "$(nproc)" && \ + make altinstall && \ + rm -rf /tmp/* + +FROM ${BASE} AS official + +ARG VERSION + +COPY --from=builder /usr/local/python${VERSION} /usr/local/python${VERSION} + +RUN VERSION_SHORT=$(echo "${VERSION}" | cut -d. -f1,2) && \ + VERSION_MAJOR=$(echo "${VERSION}" | cut -d. -f1) && \ + PY_HOME=/usr/local/python${VERSION} && \ + ln -sf ${PY_HOME}/bin/python${VERSION_SHORT} ${PY_HOME}/bin/python${VERSION_MAJOR} && \ + ln -sf ${PY_HOME}/bin/pip${VERSION_SHORT} ${PY_HOME}/bin/pip${VERSION_MAJOR} && \ + ln -sf ${PY_HOME}/bin/python${VERSION_MAJOR} ${PY_HOME}/bin/python && \ + ln -sf ${PY_HOME}/bin/pip${VERSION_MAJOR} ${PY_HOME}/bin/pip + +RUN echo "${VERSION}" > /test.txt + +ENV PATH=/usr/local/python${VERSION}/bin:${PATH} \ No newline at end of file diff --git a/Others/python/3.12.10/24.03-lts/Dockerfile b/Others/python/3.12.10/24.03-lts/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..12220d3cd8feb286e5588b12eb16cebc7fedc8b9 --- /dev/null +++ b/Others/python/3.12.10/24.03-lts/Dockerfile @@ -0,0 +1,63 @@ +ARG BASE=openeuler/openeuler:24.03-lts +ARG VERSION=3.12.10 + +FROM ${BASE} as builder + +ARG VERSION +ARG TARGETARCH + +# Install dependencies +RUN yum update -y && \ + yum install -y \ + gcc \ + gcc-c++ \ + make \ + cmake \ + curl \ + zlib-devel \ + bzip2-devel \ + openssl-devel \ + ncurses-devel \ + sqlite-devel \ + readline-devel \ + tk-devel \ + gdbm-devel \ + libpcap-devel \ + xz-devel \ + libev-devel \ + expat-devel \ + libffi-devel \ + systemtap-sdt-devel && \ + yum clean all && \ + rm -rf /var/cache/yum && \ + rm -rf /tmp/* + +RUN PY_HOME=/usr/local/python${VERSION} && \ + PY_INSTALLER_DIR=Python-${VERSION} && \ + PY_INSTALLER_TGZ=Python-${VERSION}.tgz && \ + curl -fsSL -o "/tmp/${PY_INSTALLER_TGZ}" "https://repo.huaweicloud.com/python/${VERSION}/${PY_INSTALLER_TGZ}" && \ + tar -xf /tmp/${PY_INSTALLER_TGZ} -C /tmp && \ + cd /tmp/${PY_INSTALLER_DIR} && \ + mkdir -p /${PY_HOME}/lib && \ + ./configure --prefix=${PY_HOME} --enable-shared LDFLAGS="-Wl,-rpath ${PY_HOME}/lib" && \ + make -j "$(nproc)" && \ + make altinstall && \ + rm -rf /tmp/* + +FROM ${BASE} AS official + +ARG VERSION + +COPY --from=builder /usr/local/python${VERSION} /usr/local/python${VERSION} + +RUN VERSION_SHORT=$(echo "${VERSION}" | cut -d. -f1,2) && \ + VERSION_MAJOR=$(echo "${VERSION}" | cut -d. -f1) && \ + PY_HOME=/usr/local/python${VERSION} && \ + ln -sf ${PY_HOME}/bin/python${VERSION_SHORT} ${PY_HOME}/bin/python${VERSION_MAJOR} && \ + ln -sf ${PY_HOME}/bin/pip${VERSION_SHORT} ${PY_HOME}/bin/pip${VERSION_MAJOR} && \ + ln -sf ${PY_HOME}/bin/python${VERSION_MAJOR} ${PY_HOME}/bin/python && \ + ln -sf ${PY_HOME}/bin/pip${VERSION_MAJOR} ${PY_HOME}/bin/pip + +RUN echo "${VERSION}" > /test.txt + +ENV PATH=/usr/local/python${VERSION}/bin:${PATH} \ No newline at end of file diff --git a/Others/python/3.13.4/22.03-lts/Dockerfile b/Others/python/3.13.4/22.03-lts/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..b67f37dac36a75230e2b6c3d61026e2ddba287e5 --- /dev/null +++ b/Others/python/3.13.4/22.03-lts/Dockerfile @@ -0,0 +1,63 @@ +ARG BASE=openeuler/openeuler:22.03-lts +ARG VERSION=3.13.4 + +FROM ${BASE} as builder + +ARG VERSION +ARG TARGETARCH + +# Install dependencies +RUN yum update -y && \ + yum install -y \ + gcc \ + gcc-c++ \ + make \ + cmake \ + curl \ + zlib-devel \ + bzip2-devel \ + openssl-devel \ + ncurses-devel \ + sqlite-devel \ + readline-devel \ + tk-devel \ + gdbm-devel \ + libpcap-devel \ + xz-devel \ + libev-devel \ + expat-devel \ + libffi-devel \ + systemtap-sdt-devel && \ + yum clean all && \ + rm -rf /var/cache/yum && \ + rm -rf /tmp/* + +RUN PY_HOME=/usr/local/python${VERSION} && \ + PY_INSTALLER_DIR=Python-${VERSION} && \ + PY_INSTALLER_TGZ=Python-${VERSION}.tgz && \ + curl -fsSL -o "/tmp/${PY_INSTALLER_TGZ}" "https://repo.huaweicloud.com/python/${VERSION}/${PY_INSTALLER_TGZ}" && \ + tar -xf /tmp/${PY_INSTALLER_TGZ} -C /tmp && \ + cd /tmp/${PY_INSTALLER_DIR} && \ + mkdir -p /${PY_HOME}/lib && \ + ./configure --prefix=${PY_HOME} --enable-shared LDFLAGS="-Wl,-rpath ${PY_HOME}/lib" && \ + make -j "$(nproc)" && \ + make altinstall && \ + rm -rf /tmp/* + +FROM ${BASE} AS official + +ARG VERSION + +COPY --from=builder /usr/local/python${VERSION} /usr/local/python${VERSION} + +RUN VERSION_SHORT=$(echo "${VERSION}" | cut -d. -f1,2) && \ + VERSION_MAJOR=$(echo "${VERSION}" | cut -d. -f1) && \ + PY_HOME=/usr/local/python${VERSION} && \ + ln -sf ${PY_HOME}/bin/python${VERSION_SHORT} ${PY_HOME}/bin/python${VERSION_MAJOR} && \ + ln -sf ${PY_HOME}/bin/pip${VERSION_SHORT} ${PY_HOME}/bin/pip${VERSION_MAJOR} && \ + ln -sf ${PY_HOME}/bin/python${VERSION_MAJOR} ${PY_HOME}/bin/python && \ + ln -sf ${PY_HOME}/bin/pip${VERSION_MAJOR} ${PY_HOME}/bin/pip + +RUN echo "${VERSION}" > /test.txt + +ENV PATH=/usr/local/python${VERSION}/bin:${PATH} \ No newline at end of file diff --git a/Others/python/3.13.4/24.03-lts/Dockerfile b/Others/python/3.13.4/24.03-lts/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..b16d9ddda5a3647075650eb77635fc616da9a5fa --- /dev/null +++ b/Others/python/3.13.4/24.03-lts/Dockerfile @@ -0,0 +1,63 @@ +ARG BASE=openeuler/openeuler:24.03-lts +ARG VERSION=3.13.4 + +FROM ${BASE} as builder + +ARG VERSION +ARG TARGETARCH + +# Install dependencies +RUN yum update -y && \ + yum install -y \ + gcc \ + gcc-c++ \ + make \ + cmake \ + curl \ + zlib-devel \ + bzip2-devel \ + openssl-devel \ + ncurses-devel \ + sqlite-devel \ + readline-devel \ + tk-devel \ + gdbm-devel \ + libpcap-devel \ + xz-devel \ + libev-devel \ + expat-devel \ + libffi-devel \ + systemtap-sdt-devel && \ + yum clean all && \ + rm -rf /var/cache/yum && \ + rm -rf /tmp/* + +RUN PY_HOME=/usr/local/python${VERSION} && \ + PY_INSTALLER_DIR=Python-${VERSION} && \ + PY_INSTALLER_TGZ=Python-${VERSION}.tgz && \ + curl -fsSL -o "/tmp/${PY_INSTALLER_TGZ}" "https://repo.huaweicloud.com/python/${VERSION}/${PY_INSTALLER_TGZ}" && \ + tar -xf /tmp/${PY_INSTALLER_TGZ} -C /tmp && \ + cd /tmp/${PY_INSTALLER_DIR} && \ + mkdir -p /${PY_HOME}/lib && \ + ./configure --prefix=${PY_HOME} --enable-shared LDFLAGS="-Wl,-rpath ${PY_HOME}/lib" && \ + make -j "$(nproc)" && \ + make altinstall && \ + rm -rf /tmp/* + +FROM ${BASE} AS official + +ARG VERSION + +COPY --from=builder /usr/local/python${VERSION} /usr/local/python${VERSION} + +RUN VERSION_SHORT=$(echo "${VERSION}" | cut -d. -f1,2) && \ + VERSION_MAJOR=$(echo "${VERSION}" | cut -d. -f1) && \ + PY_HOME=/usr/local/python${VERSION} && \ + ln -sf ${PY_HOME}/bin/python${VERSION_SHORT} ${PY_HOME}/bin/python${VERSION_MAJOR} && \ + ln -sf ${PY_HOME}/bin/pip${VERSION_SHORT} ${PY_HOME}/bin/pip${VERSION_MAJOR} && \ + ln -sf ${PY_HOME}/bin/python${VERSION_MAJOR} ${PY_HOME}/bin/python && \ + ln -sf ${PY_HOME}/bin/pip${VERSION_MAJOR} ${PY_HOME}/bin/pip + +RUN echo "${VERSION}" > /test.txt + +ENV PATH=/usr/local/python${VERSION}/bin:${PATH} \ No newline at end of file diff --git a/Others/python/3.9.9/22.03-lts/Dockerfile b/Others/python/3.9.9/22.03-lts/Dockerfile index 0a01e3c4620d55d7f7481063e94e784393dba3ff..92b82d9a0830e0c6f9a54fd53effff3c33d70d69 100644 --- a/Others/python/3.9.9/22.03-lts/Dockerfile +++ b/Others/python/3.9.9/22.03-lts/Dockerfile @@ -1,6 +1,63 @@ -FROM openeuler/openeuler:22.03-lts -MAINTAINER heguofeng -RUN yum -y update \ - && yum -y install python python-pip \ - && yum clean all -CMD [ "python" ] +ARG BASE=openeuler/openeuler:22.03-lts +ARG VERSION=3.9.9 + +FROM ${BASE} as builder + +ARG VERSION +ARG TARGETARCH + +# Install dependencies +RUN yum update -y && \ + yum install -y \ + gcc \ + gcc-c++ \ + make \ + cmake \ + curl \ + zlib-devel \ + bzip2-devel \ + openssl-devel \ + ncurses-devel \ + sqlite-devel \ + readline-devel \ + tk-devel \ + gdbm-devel \ + libpcap-devel \ + xz-devel \ + libev-devel \ + expat-devel \ + libffi-devel \ + systemtap-sdt-devel && \ + yum clean all && \ + rm -rf /var/cache/yum && \ + rm -rf /tmp/* + +RUN PY_HOME=/usr/local/python${VERSION} && \ + PY_INSTALLER_DIR=Python-${VERSION} && \ + PY_INSTALLER_TGZ=Python-${VERSION}.tgz && \ + curl -fsSL -o "/tmp/${PY_INSTALLER_TGZ}" "https://repo.huaweicloud.com/python/${VERSION}/${PY_INSTALLER_TGZ}" && \ + tar -xf /tmp/${PY_INSTALLER_TGZ} -C /tmp && \ + cd /tmp/${PY_INSTALLER_DIR} && \ + mkdir -p /${PY_HOME}/lib && \ + ./configure --prefix=${PY_HOME} --enable-shared LDFLAGS="-Wl,-rpath ${PY_HOME}/lib" && \ + make -j "$(nproc)" && \ + make altinstall && \ + rm -rf /tmp/* + +FROM ${BASE} AS official + +ARG VERSION + +COPY --from=builder /usr/local/python${VERSION} /usr/local/python${VERSION} + +RUN VERSION_SHORT=$(echo "${VERSION}" | cut -d. -f1,2) && \ + VERSION_MAJOR=$(echo "${VERSION}" | cut -d. -f1) && \ + PY_HOME=/usr/local/python${VERSION} && \ + ln -sf ${PY_HOME}/bin/python${VERSION_SHORT} ${PY_HOME}/bin/python${VERSION_MAJOR} && \ + ln -sf ${PY_HOME}/bin/pip${VERSION_SHORT} ${PY_HOME}/bin/pip${VERSION_MAJOR} && \ + ln -sf ${PY_HOME}/bin/python${VERSION_MAJOR} ${PY_HOME}/bin/python && \ + ln -sf ${PY_HOME}/bin/pip${VERSION_MAJOR} ${PY_HOME}/bin/pip + +RUN echo "${VERSION}" > /test.txt + +ENV PATH=/usr/local/python${VERSION}/bin:${PATH} \ No newline at end of file diff --git a/Others/python/3.9.9/24.03-lts/Dockerfile b/Others/python/3.9.9/24.03-lts/Dockerfile index 1aa720493551a464f37e6b917ea7d34f8eaad94b..e2789be852630788aa08edc2c12af5ee10a41d6e 100644 --- a/Others/python/3.9.9/24.03-lts/Dockerfile +++ b/Others/python/3.9.9/24.03-lts/Dockerfile @@ -1,12 +1,10 @@ -FROM openeuler/openeuler:24.03-lts AS py-installer +ARG BASE=openeuler/openeuler:24.03-lts +ARG VERSION=3.9.9 -ARG PY_VERSION=3.9 -ARG PY_MAJOR_VERSION=3 -ARG PY_LATEST_VERSION=3.9.9 -ARG PY_HOME="/usr/local/python${PY_VERSION}" -ARG PY_INSTALLER_TGZ="Python-${PY_LATEST_VERSION}.tgz" -ARG PY_INSTALLER_DIR="Python-${PY_LATEST_VERSION}" -ARG PY_INSTALLER_URL="https://repo.huaweicloud.com/python/${PY_LATEST_VERSION}/${PY_INSTALLER_TGZ}" +FROM ${BASE} as builder + +ARG VERSION +ARG TARGETARCH # Install dependencies RUN yum update -y && \ @@ -29,34 +27,37 @@ RUN yum update -y && \ libev-devel \ expat-devel \ libffi-devel \ - systemtap-sdt-devel \ - && yum clean all \ - && rm -rf /var/cache/yum \ - && rm -rf /tmp/* - -RUN curl -fsSL -o "/tmp/${PY_INSTALLER_TGZ}" "${PY_INSTALLER_URL}" && \ + systemtap-sdt-devel && \ + yum clean all && \ + rm -rf /var/cache/yum && \ + rm -rf /tmp/* + +RUN PY_HOME=/usr/local/python${VERSION} && \ + PY_INSTALLER_DIR=Python-${VERSION} && \ + PY_INSTALLER_TGZ=Python-${VERSION}.tgz && \ + curl -fsSL -o "/tmp/${PY_INSTALLER_TGZ}" "https://repo.huaweicloud.com/python/${VERSION}/${PY_INSTALLER_TGZ}" && \ tar -xf /tmp/${PY_INSTALLER_TGZ} -C /tmp && \ cd /tmp/${PY_INSTALLER_DIR} && \ mkdir -p /${PY_HOME}/lib && \ ./configure --prefix=${PY_HOME} --enable-shared LDFLAGS="-Wl,-rpath ${PY_HOME}/lib" && \ make -j "$(nproc)" && \ - make altinstall - + make altinstall && \ + rm -rf /tmp/* -RUN rm -rf /tmp/${PY_INSTALLER_TGZ} /tmp/${PY_INSTALLER_DIR} +FROM ${BASE} AS official -FROM openeuler/openeuler:24.03-lts AS official +ARG VERSION -ARG PY_VERSION=3.9 -ARG PY_MAJOR_VERSION=3 -ARG PY_HOME="/usr/local/python${PY_VERSION}" +COPY --from=builder /usr/local/python${VERSION} /usr/local/python${VERSION} -COPY --from=py-installer /usr/local/python${PY_VERSION} /usr/local/python${PY_VERSION} +RUN VERSION_SHORT=$(echo "${VERSION}" | cut -d. -f1,2) && \ + VERSION_MAJOR=$(echo "${VERSION}" | cut -d. -f1) && \ + PY_HOME=/usr/local/python${VERSION} && \ + ln -sf ${PY_HOME}/bin/python${VERSION_SHORT} ${PY_HOME}/bin/python${VERSION_MAJOR} && \ + ln -sf ${PY_HOME}/bin/pip${VERSION_SHORT} ${PY_HOME}/bin/pip${VERSION_MAJOR} && \ + ln -sf ${PY_HOME}/bin/python${VERSION_MAJOR} ${PY_HOME}/bin/python && \ + ln -sf ${PY_HOME}/bin/pip${VERSION_MAJOR} ${PY_HOME}/bin/pip -RUN ln -sf ${PY_HOME}/bin/python${PY_VERSION} /usr/bin/python${PY_VERSION} && \ - ln -sf ${PY_HOME}/bin/pip${PY_VERSION} /usr/bin/pip${PY_VERSION} && \ - ln -sf /usr/bin/python${PY_VERSION} /usr/bin/python${PY_MAJOR_VERSION} && \ - ln -sf /usr/bin/pip${PY_VERSION} /usr/bin/pip${PY_MAJOR_VERSION} && \ - ln -sf /usr/bin/python${PY_MAJOR_VERSION} /usr/bin/python && \ - ln -sf /usr/bin/pip${PY_MAJOR_VERSION} /usr/bin/pip +RUN echo "${VERSION}" > /test.txt +ENV PATH=/usr/local/python${VERSION}/bin:${PATH} \ No newline at end of file diff --git a/Others/python/README.md b/Others/python/README.md index 9712f0739bd5718f6db87369508d82312a746fe8..d4f7e338b0656d2d3a24327138c3b657b0b90526 100644 --- a/Others/python/README.md +++ b/Others/python/README.md @@ -18,7 +18,15 @@ The tag of each Python docker image is consist of the version of Python and the | Tags | Currently | Architectures| |--|--|--| |[3.9.9-oe2203lts](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/Others/python/3.9.9/22.03-lts/Dockerfile)| Python 3.9.9 on openEuler 22.03-LTS | amd64, arm64 | +|[3.9.9-oe2403lts](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/Others/python/3.9.9/24.03-lts/Dockerfile)| Python 3.9.9 on openEuler 24.03-LTS | amd64, arm64 | +|[3.10.17-oe2203lts](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/Others/python/3.10.17/22.03-lts/Dockerfile)| Python 3.10.17 on openEuler 22.03-LTS | amd64, arm64 | |[3.10.17-oe2403lts](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/Others/python/3.10.17/24.03-lts/Dockerfile)| Python 3.10.17 on openEuler 24.03-LTS | amd64, arm64 | +|[3.11.13-oe2203lts](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/Others/python/3.11.13/22.03-lts/Dockerfile)| Python 3.11.13 on openEuler 22.03-LTS | amd64, arm64 | +|[3.11.13-oe2403lts](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/Others/python/3.11.13/24.03-lts/Dockerfile)| Python 3.11.13 on openEuler 24.03-LTS | amd64, arm64 | +|[3.12.10-oe2203lts](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/Others/python/3.12.10/22.03-lts/Dockerfile)| Python 3.12.10 on openEuler 22.03-LTS | amd64, arm64 | +|[3.12.10-oe2403lts](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/Others/python/3.12.10/24.03-lts/Dockerfile)| Python 3.12.10 on openEuler 24.03-LTS | amd64, arm64 | +|[3.13.4-oe2203lts](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/Others/python/3.13.4/22.03-lts/Dockerfile)| Python 3.13.4 on openEuler 22.03-LTS | amd64, arm64 | +|[3.13.4-oe2403lts](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Others/Others/python/3.13.4/24.03-lts/Dockerfile)| Python 3.13.4 on openEuler 24.03-LTS | amd64, arm64 | # Usage diff --git a/Others/python/meta.yml b/Others/python/meta.yml index 5d25e33260986beb9b457aefbcbacfa7ced02e76..6bf7f3cce6c8b4ebb9c901b31628049f1767f79b 100644 --- a/Others/python/meta.yml +++ b/Others/python/meta.yml @@ -1,4 +1,20 @@ 3.9.9-oe2203lts: path: 3.9.9/22.03-lts/Dockerfile +3.9.9-oe2403lts: + path: 3.9.9/24.03-lts/Dockerfile +3.10.17-oe2203lts: + path: 3.10.17/22.03-lts/Dockerfile 3.10.17-oe2403lts: path: 3.10.17/24.03-lts/Dockerfile +3.11.13-oe2203lts: + path: 3.11.13/22.03-lts/Dockerfile +3.11.13-oe2403lts: + path: 3.11.13/24.03-lts/Dockerfile +3.12.10-oe2203lts: + path: 3.12.10/22.03-lts/Dockerfile +3.12.10-oe2403lts: + path: 3.12.10/24.03-lts/Dockerfile +3.13.4-oe2203lts: + path: 3.13.4/22.03-lts/Dockerfile +3.13.4-oe2403lts: + path: 3.13.4/24.03-lts/Dockerfile \ No newline at end of file