diff --git a/.github/workflows/Docker-images.yml b/.github/workflows/Docker-images.yml index 3d8f5f9..df24b22 100644 --- a/.github/workflows/Docker-images.yml +++ b/.github/workflows/Docker-images.yml @@ -80,6 +80,58 @@ jobs: secrets: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + + build_ubi9_python313_image: + needs: [ tags, build_ubi9_image ] + uses: ./.github/workflows/Docker.yml + with: + image_name: "axaguildev/build-ubi9-python3.13" + image_version: ${{ needs.tags.outputs.new_version }} + image_build_args: "baseImage=axaguildev/build-ubi9:${{ needs.tags.outputs.new_version }}" + image_context: ./build/Python313 + image_file: "./build/Python313/Dockerfile.ubi9" + secrets: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + + runtime_ubi9_python313_image: + needs: [ tags,runtime_ubi9_image ] + uses: ./.github/workflows/Docker.yml + with: + image_name: "axaguildev/runtime-ubi9-python3.13" + image_version: ${{ needs.tags.outputs.new_version }} + image_build_args: "baseImage=axaguildev/runtime-ubi9:${{ needs.tags.outputs.new_version }}" + image_context: ./runtime/Python313 + image_file: "./runtime/Python313/Dockerfile.ubi9" + secrets: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + + build_ubi9_python312_image: + needs: [ tags, build_ubi9_image ] + uses: ./.github/workflows/Docker.yml + with: + image_name: "axaguildev/build-ubi9-python3.12" + image_version: ${{ needs.tags.outputs.new_version }} + image_build_args: "baseImage=axaguildev/build-ubi9:${{ needs.tags.outputs.new_version }}" + image_context: ./build/Python312 + image_file: "./build/Python312/Dockerfile.ubi9" + secrets: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + + runtime_ubi9_python312_image: + needs: [ tags,runtime_ubi9_image ] + uses: ./.github/workflows/Docker.yml + with: + image_name: "axaguildev/runtime-ubi9-python3.12" + image_version: ${{ needs.tags.outputs.new_version }} + image_build_args: "baseImage=axaguildev/runtime-ubi9:${{ needs.tags.outputs.new_version }}" + image_context: ./runtime/Python312 + image_file: "./runtime/Python312/Dockerfile.ubi9" + secrets: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} build_ubi9_python311_image: needs: [ tags, build_ubi9_image ] @@ -199,95 +251,3 @@ jobs: image_name: "axaguildev/build-ubi9-python3.11-tesseract" image_version: ${{ needs.tags.outputs.new_version }} image_build_args: "baseImage=axaguildev/build-ubi9-python3.11:${{ needs.tags.outputs.new_version }}" - - - build_ubi8_image: - needs: tags - uses: ./.github/workflows/Docker.yml - with: - image_name: "axaguildev/build-ubi8" - image_version: "${{ needs.tags.outputs.new_version }}" - image_build_args: "baseImage=registry.access.redhat.com/ubi8/ubi:latest" - image_context: ./ubi - image_file: "./Dockerfile.ubi8" - secrets: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - - runtime_ubi8_image: - needs: tags - uses: ./.github/workflows/Docker.yml - with: - image_name: "axaguildev/runtime-ubi8" - image_version: ${{ needs.tags.outputs.new_version }} - image_build_args: "baseImage=registry.access.redhat.com/ubi8/ubi-minimal:latest" - image_context: ./ubi - image_file: "./Dockerfile.ubi8-minimal" - secrets: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - - build_ubi8_python38_image: - needs: [tags,build_ubi8_image] - uses: ./.github/workflows/Docker.yml - with: - image_name: "axaguildev/build-ubi8-python3.8" - image_version: ${{ needs.tags.outputs.new_version }} - image_build_args: "baseImage=axaguildev/build-ubi8:${{ needs.tags.outputs.new_version }}" - image_context: ./build/Python38 - image_file: "./build/Python38/Dockerfile.ubi8" - secrets: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - - runtime_ubi8_python38_image: - needs: [tags,runtime_ubi8_image] - uses: ./.github/workflows/Docker.yml - with: - image_name: "axaguildev/runtime-ubi8-python3.8" - image_version: ${{ needs.tags.outputs.new_version }} - image_build_args: "baseImage=axaguildev/runtime-ubi8:${{ needs.tags.outputs.new_version }}" - image_context: ./runtime/Python38 - image_file: "./runtime/Python38/Dockerfile.ubi8" - secrets: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - - build_python310_image: - needs: [tags,build_ubi8_image] - uses: ./.github/workflows/Docker.yml - with: - image_name: "axaguildev/build-ubi8-python3.10" - image_version: ${{ needs.tags.outputs.new_version }} - image_build_args: "baseImage=axaguildev/build-ubi8:${{ needs.tags.outputs.new_version }} " - image_context: ./build/Python310 - image_file: "./build/Python310/Dockerfile.ubi8" - secrets: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - - runtime_ubi8_python310_image: - needs: [tags,runtime_ubi8_image] - uses: ./.github/workflows/Docker.yml - with: - image_name: "axaguildev/runtime-ubi8-python3.10" - image_version: ${{ needs.tags.outputs.new_version }} - image_build_args: "baseImage=axaguildev/runtime-ubi8:${{ needs.tags.outputs.new_version }}" - image_context: ./runtime/Python310 - image_file: "./runtime/Python310/Dockerfile.ubi8" - secrets: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - - build_ubi8_python38_tesseract_image: - needs: [tags,build_ubi8_image,build_ubi8_python38_image] - uses: ./.github/workflows/Docker.yml - secrets: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - with: - image_context: ./ubi - image_file : "./Dockerfile.ubi8-tesseract" - image_name: "axaguildev/build-ubi8-python3.8-tesseract" - image_version: ${{ needs.tags.outputs.new_version }} - image_build_args: "baseImage=axaguildev/build-ubi8-python3.8:${{ needs.tags.outputs.new_version }}" \ No newline at end of file diff --git a/.github/workflows/Docker.yml b/.github/workflows/Docker.yml index eedf7d3..bab1ddd 100644 --- a/.github/workflows/Docker.yml +++ b/.github/workflows/Docker.yml @@ -33,6 +33,12 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Log in to Docker Hub uses: docker/login-action@v2 @@ -54,6 +60,7 @@ jobs: file : ${{ inputs.image_file }} build-args: ${{ inputs.image_build_args }} push: true + platforms: linux/amd64,linux/arm64 tags: ${{ inputs.image_name }}:${{ inputs.image_version }},${{ inputs.image_name }}:latest labels: ${{ steps.meta.outputs.labels }} @@ -65,5 +72,6 @@ jobs: file : ${{ inputs.image_file }} build-args: ${{ inputs.image_build_args }} push: true + platforms: linux/amd64,linux/arm64 tags: ${{ inputs.image_name }}:${{ inputs.image_version }} labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile.ubi8 b/Dockerfile.ubi8 deleted file mode 100644 index c37bfe4..0000000 --- a/Dockerfile.ubi8 +++ /dev/null @@ -1,64 +0,0 @@ -ARG baseImage -FROM ${baseImage} - - - -LABEL target="os" -LABEL stack="ubi" -LABEL os="linux" -LABEL description="ubi os image" - -ENV \ - APP_ROOT=/opt/app-root \ - # The $HOME is not set by default, but some applications needs this variable - HOME=/opt/app-root \ - PATH=/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ - USER=1001 \ - PLATFORM="el8" - -RUN INSTALL_PKGS="bsdtar \ - findutils \ - groff-base \ - glibc-locale-source \ - glibc-langpack-en \ - gettext \ - rsync \ - scl-utils \ - tar \ - unzip \ - xz \ - openssl" && \ - mkdir -p ${HOME}/.pki/nssdb && \ - chown -R ${USER}:0 ${HOME}/.pki && \ - dnf install -y --setopt=tsflags=nodocs --noplugins $INSTALL_PKGS && \ - rpm -V $INSTALL_PKGS && \ - dnf -y clean all --enablerepo='*' - -ENV LANG C.utf8 -ENV LC_CTYPE C.utf8 -ENV LC_NUMERIC C.utf8 -ENV LC_TIME C.utf8 -ENV LC_COLLATE C.utf8 -ENV LC_MONETARY C.utf8 -ENV LC_MESSAGES C.utf8 -ENV LC_PAPER C.utf8 -ENV LC_NAME C.utf8 -ENV LC_ADDRESS C.utf8 -ENV LC_TELEPHONE C.utf8 -ENV LC_MEASUREMENT C.utf8 -ENV LC_IDENTIFICATION C.utf8 -ENV LC_ALL C.utf8 - -#USER root -# Copy extra files to the image. -COPY ./root/ / - -# Reset permissions of modified directories and add default user -RUN chmod +x /usr/bin/rpm-file-permissions && \ - rpm-file-permissions && \ - useradd -u ${USER} -r -g 0 -d ${HOME} -s /sbin/nologin \ - -c "Default Application User" default && \ - chown -R ${USER}:0 ${APP_ROOT} - -WORKDIR ${APP_ROOT} - diff --git a/Dockerfile.ubi8-minimal b/Dockerfile.ubi8-minimal deleted file mode 100644 index 027995d..0000000 --- a/Dockerfile.ubi8-minimal +++ /dev/null @@ -1,61 +0,0 @@ -ARG baseImage -FROM ${baseImage} - -#### Labels -## target : define the image purpose -## alm_base / alm_build / alm_release => AzureDevOps agents -## os => base os image -## build => stack build image -## runtime => stack runtime -LABEL target="os" -## stack : define the stack (ex python, tomcat, alm, ...) -LABEL stack="ubi" -## os : define the os -LABEL os="linux" -## description -LABEL description="ubi os image" -#### Envs -## specific - -ENV \ - APP_ROOT=/opt/app-root \ - # The $HOME is not set by default, but some applications needs this variable - HOME=/opt/app-root \ - PATH=/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ - USER=1001 \ - PLATFORM="el8" - -RUN INSTALL_PKGS="shadow-utils findutils openssl gettext" && \ - mkdir -p ${HOME}/.pki/nssdb && \ - chown -R ${USER}:0 ${HOME}/.pki && \ - microdnf -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ - rpm -V $INSTALL_PKGS && \ - microdnf -y clean all --enablerepo='*' - -ENV LANG C.utf8 -ENV LC_CTYPE C.utf8 -ENV LC_NUMERIC C.utf8 -ENV LC_TIME C.utf8 -ENV LC_COLLATE C.utf8 -ENV LC_MONETARY C.utf8 -ENV LC_MESSAGES C.utf8 -ENV LC_PAPER C.utf8 -ENV LC_NAME C.utf8 -ENV LC_ADDRESS C.utf8 -ENV LC_TELEPHONE C.utf8 -ENV LC_MEASUREMENT C.utf8 -ENV LC_IDENTIFICATION C.utf8 -ENV LC_ALL C.utf8 - -# Copy extra files to the image. -COPY ./root/ / - -# Reset permissions of modified directories and add default user -RUN chmod +x /usr/bin/rpm-file-permissions && rpm-file-permissions && \ - useradd -u ${USER} -r -g 0 -d ${HOME} -s /sbin/nologin \ - -c "Default Application User" default && \ - mkdir -p ${APP_ROOT} && \ - chown -R ${USER}:0 ${APP_ROOT} - -WORKDIR ${APP_ROOT} - diff --git a/Dockerfile.ubi8-tesseract b/Dockerfile.ubi8-tesseract deleted file mode 100644 index e0a2cd8..0000000 --- a/Dockerfile.ubi8-tesseract +++ /dev/null @@ -1,37 +0,0 @@ -ARG baseImage -FROM ${baseImage} - -USER root - -RUN INSTALL_PKGS="automake libtool libjpeg-turbo-devel zlib-devel libwebp-devel libtiff-devel libpng-devel" && \ - dnf -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ - rpm -V $INSTALL_PKGS && \ - dnf -y clean all --enablerepo='*' - -USER ${USER} - -ENV TESSERACT_VERSION=4.1.1 -ENV LEPTONICA_VERSION=1.80.0 - -WORKDIR ${APP_ROOT} - -ENV LOCAL=${APP_ROOT}/local - -RUN curl -fsSL https://github.com/DanBloomberg/leptonica/releases/download/${LEPTONICA_VERSION}/leptonica-${LEPTONICA_VERSION}.tar.gz -O && \ - tar xvfz leptonica-${LEPTONICA_VERSION}.tar.gz && \ - cd leptonica-${LEPTONICA_VERSION} && \ - ./autogen.sh && \ - ./configure --prefix=${LOCAL} && \ - make && \ - make install - -ENV LOCAL_LIB=${LOCAL}/lib -ENV PKG_CONFIG_PATH=${LOCAL_LIB}/pkgconfig - -RUN curl -fsSL https://github.com/tesseract-ocr/tesseract/archive/${TESSERACT_VERSION}.tar.gz -O && \ - tar xvfz ${TESSERACT_VERSION}.tar.gz && \ - cd tesseract-${TESSERACT_VERSION} && \ - ./autogen.sh && \ - ./configure --prefix=${LOCAL} --with-extra-libraries=${LOCAL_LIB} --disable-openmp 'CXXFLAGS=-g -O2 -fno-math-errno -Wall -Wextra -Wpedantic' && \ - make && \ - make install diff --git a/Dockerfile.ubi9 b/Dockerfile.ubi9 index c37bfe4..72bfd06 100644 --- a/Dockerfile.ubi9 +++ b/Dockerfile.ubi9 @@ -1,8 +1,6 @@ ARG baseImage FROM ${baseImage} - - LABEL target="os" LABEL stack="ubi" LABEL os="linux" diff --git a/README.md b/README.md index 78f4974..5c7a9fa 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,11 @@ Create docker image base : - UBI9 runtime python 3.11 [![Docker UBI 9 runtime Python 3.11](https://img.shields.io/docker/pulls/axaguildev/runtime-ubi9-python3.11.svg)](https://hub.docker.com/r/axaguildev/runtime-ubi9-python3.11) - UBI9 build python 3.11 with tesseract [![Docker UBI 9 Python 3.1 tesseract](https://img.shields.io/docker/pulls/axaguildev/build-ubi9-python3.11-tesseract.svg)](https://hub.docker.com/r/axaguildev/build-ubi9-python3.11-tesseract) +- UBI9 build python 3.12 [![Docker UBI 9 build Python 3.12](https://img.shields.io/docker/pulls/axaguildev/build-ubi9-python3.12.svg)](https://hub.docker.com/r/axaguildev/build-ubi9-python3.12) +- UBI9 runtime python 3.12 [![Docker UBI 9 runtime Python 3.12](https://img.shields.io/docker/pulls/axaguildev/runtime-ubi9-python3.12.svg)](https://hub.docker.com/r/axaguildev/runtime-ubi9-python3.12) + +- UBI9 build python 3.13 [![Docker UBI 9 build Python 3.13](https://img.shields.io/docker/pulls/axaguildev/build-ubi9-python3.13.svg)](https://hub.docker.com/r/axaguildev/build-ubi9-python3.13) +- UBI9 runtime python 3.13 [![Docker UBI 9 runtime Python 3.13](https://img.shields.io/docker/pulls/axaguildev/runtime-ubi9-python3.13.svg)](https://hub.docker.com/r/axaguildev/runtime-ubi9-python3.13) - UBI9 build node20 [![Docker UBI 9 build node 20](https://img.shields.io/docker/pulls/axaguildev/build-ubi9-node20.svg)](https://hub.docker.com/r/axaguildev/build-ubi9-node20) - UBI9 runtime nginx [![Docker UBI 9 runtime nginx](https://img.shields.io/docker/pulls/axaguildev/runtime-ubi9-nginx.svg)](https://hub.docker.com/r/axaguildev/runtime-ubi9-nginx) \ No newline at end of file diff --git a/build/Python310/Dockerfile.ubi8 b/build/Python310/Dockerfile.ubi8 deleted file mode 100644 index 2b58024..0000000 --- a/build/Python310/Dockerfile.ubi8 +++ /dev/null @@ -1,58 +0,0 @@ -ARG baseImage -FROM ${baseImage} as build - -ENV PYTHON_VERSION 3.10 -ENV PYTHON_PATCH_VERSION 4 -ENV ARCH amd64 - -ENV PYTHON_DIR=/opt/python -ENV PATH ${PYTHON_DIR}/bin:$PATH -ENV LANG C.UTF-8 - -WORKDIR ${HOME} - -RUN dnf install -y --setopt=tsflags=nodocs gcc openssl-devel bzip2-devel libffi-devel expat-devel make wget cmake git \ - && wget https://www.python.org/ftp/python/${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}/Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}.tgz \ - && tar xzf Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}.tgz \ - && cd Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION} \ - && ./configure --prefix=${PYTHON_DIR} \ - --build="$ARCH" \ - --enable-loadable-sqlite-extensions \ - --enable-optimizations \ - --enable-option-checking=fatal \ - --enable-shared \ - --with-system-expat \ - --with-system-ffi \ - && make -j "$(nproc)" \ - && make install \ - && ldconfig ${PYTHON_DIR}/lib \ - && find ${PYTHON_DIR} -depth \ - \( \ - \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ - -o \ - \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ - \) -exec rm -rf '{}' + - -FROM ${baseImage} as runtime - -ENV PYTHON_DIR=/opt/python -ENV PATH ${PYTHON_DIR}/bin:$PATH -ENV LANG C.UTF-8 - -ENV PYTHON_VERSION 3.10 -ENV PYTHON_PATCH_VERSION 4 - -COPY --from=build ${PYTHON_DIR} ${PYTHON_DIR} -RUN ldconfig ${PYTHON_DIR}/lib - -# - In order to drop the root user, we have to make some directories world -# writable as OpenShift default security model is to run the container -# under random UID. -RUN chown -R ${USER}:0 ${APP_ROOT} && \ - chmod +x /usr/bin/fix-permissions && \ - fix-permissions ${APP_ROOT} -P && \ - rpm-file-permissions - -USER ${USER} - -RUN python3 -m pip install --upgrade --user pip wheel && find ${APP_ROOT}/.local -type d -exec chmod 0755 {} \; \ No newline at end of file diff --git a/build/Python310/Dockerfile.ubi9 b/build/Python310/Dockerfile.ubi9 index 2516069..e72a0b7 100644 --- a/build/Python310/Dockerfile.ubi9 +++ b/build/Python310/Dockerfile.ubi9 @@ -1,48 +1,49 @@ ARG baseImage FROM ${baseImage} as build -ENV PYTHON_VERSION 3.10 -ENV PYTHON_PATCH_VERSION 13 -ENV ARCH amd64 +ENV PYTHON_VERSION=3.10 +ENV PYTHON_PATCH_VERSION=13 ENV PYTHON_DIR=/opt/python -ENV PATH ${PYTHON_DIR}/bin:$PATH -ENV LANG C.UTF-8 +ENV PATH=${PYTHON_DIR}/bin:$PATH +ENV LANG=C.UTF-8 WORKDIR ${HOME} -RUN dnf install -y --setopt=tsflags=nodocs gcc openssl-devel bzip2-devel libffi-devel expat-devel make diffutils file gcc-c++ wget cmake git zlib-devel sqlite-devel \ +RUN dnf install -y --setopt=tsflags=nodocs \ + gcc openssl-devel bzip2-devel libffi-devel expat-devel make diffutils file \ + gcc-c++ wget cmake git zlib-devel sqlite-devel \ && wget https://www.python.org/ftp/python/${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}/Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}.tgz \ && tar xzf Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}.tgz \ && cd Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION} \ && ./configure --prefix=${PYTHON_DIR} \ - --build="$ARCH" \ - --enable-loadable-sqlite-extensions \ - --enable-optimizations \ - --enable-option-checking=fatal \ - --enable-shared \ - --with-system-expat \ - --with-system-ffi \ - && make -j "$(nproc)" \ + --enable-loadable-sqlite-extensions \ + --enable-optimizations \ + --enable-option-checking=fatal \ + --enable-shared \ + --with-system-expat \ + --with-system-ffi \ + && make -j"$(nproc)" \ && make install \ && ldconfig ${PYTHON_DIR}/lib \ && find ${PYTHON_DIR} -depth \ - \( \ - \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ - -o \ - \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ - \) -exec rm -rf '{}' + + \( \ + \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' + FROM ${baseImage} as runtime ENV PYTHON_DIR=/opt/python -ENV PATH ${PYTHON_DIR}/bin:$PATH -ENV LANG C.UTF-8 +ENV PATH=${PYTHON_DIR}/bin:$PATH +ENV LANG=C.UTF-8 -ENV PYTHON_VERSION 3.10 -ENV PYTHON_PATCH_VERSION 13 +ENV PYTHON_VERSION=3.10 +ENV PYTHON_PATCH_VERSION=13 COPY --from=build ${PYTHON_DIR} ${PYTHON_DIR} +ENV LD_LIBRARY_PATH=${PYTHON_DIR}/lib:${LD_LIBRARY_PATH} RUN ldconfig ${PYTHON_DIR}/lib # - In order to drop the root user, we have to make some directories world @@ -50,9 +51,10 @@ RUN ldconfig ${PYTHON_DIR}/lib # under random UID. RUN chown -R ${USER}:0 ${APP_ROOT} && \ chmod +x /usr/bin/fix-permissions && \ - fix-permissions ${APP_ROOT} -P && \ - rpm-file-permissions + fix-permissions ${APP_ROOT} -P && \ + rpm-file-permissions USER ${USER} -RUN python3 -m pip install --upgrade --user pip wheel && find ${APP_ROOT}/.local -type d -exec chmod 0755 {} \; \ No newline at end of file +RUN python3 -m pip install --upgrade --user pip wheel && \ + find ${APP_ROOT}/.local -type d -exec chmod 0755 {} \; diff --git a/build/Python311/Dockerfile.ubi9 b/build/Python311/Dockerfile.ubi9 index 1ec090f..47a7b19 100644 --- a/build/Python311/Dockerfile.ubi9 +++ b/build/Python311/Dockerfile.ubi9 @@ -1,50 +1,49 @@ ARG baseImage FROM ${baseImage} as build -ENV PYTHON_VERSION 3.11 -ENV PYTHON_PATCH_VERSION 13 -ENV ARCH amd64 +ENV PYTHON_VERSION=3.11 +ENV PYTHON_PATCH_VERSION=14 ENV PYTHON_DIR=/opt/python -ENV PATH ${PYTHON_DIR}/bin:$PATH -ENV LANG C.UTF-8 +ENV PATH=${PYTHON_DIR}/bin:$PATH +ENV LANG=C.UTF-8 WORKDIR ${HOME} - -RUN dnf install -y --setopt=tsflags=nodocs gcc openssl-devel bzip2-devel libffi-devel expat-devel make wget cmake git zlib-devel sqlite-devel ncurses-devel \ +RUN dnf install -y --setopt=tsflags=nodocs \ + gcc openssl-devel bzip2-devel libffi-devel expat-devel make wget cmake git \ + zlib-devel sqlite-devel ncurses-devel \ && wget https://www.python.org/ftp/python/${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}/Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}.tgz \ && tar xzf Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}.tgz \ && cd Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION} \ && ./configure --prefix=${PYTHON_DIR} \ - --build="$ARCH" \ - --enable-loadable-sqlite-extensions \ - --enable-optimizations \ - --enable-option-checking=fatal \ - --enable-shared \ - --with-system-expat \ - --with-system-ffi \ - && make -j "$(nproc)" \ + --enable-loadable-sqlite-extensions \ + --enable-optimizations \ + --enable-option-checking=fatal \ + --enable-shared \ + --with-system-expat \ + --with-system-ffi \ + && make -j"$(nproc)" \ && make install \ && ldconfig ${PYTHON_DIR}/lib \ && find ${PYTHON_DIR} -depth \ - \( \ - \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ - -o \ - \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ - \) -exec rm -rf '{}' + + \( \ + \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' + FROM ${baseImage} as runtime ENV PYTHON_DIR=/opt/python -ENV PATH ${PYTHON_DIR}/bin:$PATH -ENV LANG C.UTF-8 +ENV PATH=${PYTHON_DIR}/bin:$PATH +ENV LANG=C.UTF-8 -ENV PYTHON_VERSION 3.11 -ENV PYTHON_PATCH_VERSION 13 +ENV PYTHON_VERSION=3.11 +ENV PYTHON_PATCH_VERSION=14 COPY --from=build ${PYTHON_DIR} ${PYTHON_DIR} -ENV LD_LIBRARY_PATH ${PYTHON_DIR}/lib:{LD_LIBRARY_PATH} +ENV LD_LIBRARY_PATH=${PYTHON_DIR}/lib:${LD_LIBRARY_PATH} RUN ldconfig ${PYTHON_DIR}/lib # - In order to drop the root user, we have to make some directories world @@ -52,9 +51,10 @@ RUN ldconfig ${PYTHON_DIR}/lib # under random UID. RUN chown -R ${USER}:0 ${APP_ROOT} && \ chmod +x /usr/bin/fix-permissions && \ - fix-permissions ${APP_ROOT} -P && \ - rpm-file-permissions + fix-permissions ${APP_ROOT} -P && \ + rpm-file-permissions USER ${USER} -RUN python3 -m pip install --upgrade --user pip wheel && find ${APP_ROOT}/.local -type d -exec chmod 0755 {} \; \ No newline at end of file +RUN python3 -m pip install --upgrade --user pip wheel && \ + find ${APP_ROOT}/.local -type d -exec chmod 0755 {} \; diff --git a/build/Python312/Dockerfile.ubi9 b/build/Python312/Dockerfile.ubi9 new file mode 100644 index 0000000..1859d25 --- /dev/null +++ b/build/Python312/Dockerfile.ubi9 @@ -0,0 +1,59 @@ +ARG baseImage +FROM ${baseImage} as build + +ENV PYTHON_VERSION=3.12 +ENV PYTHON_PATCH_VERSION=12 + +ENV PYTHON_DIR=/opt/python +ENV PATH=${PYTHON_DIR}/bin:$PATH +ENV LANG=C.UTF-8 + +WORKDIR ${HOME} + +RUN dnf install -y --setopt=tsflags=nodocs \ + gcc openssl-devel bzip2-devel libffi-devel expat-devel make wget cmake git \ + zlib-devel sqlite-devel ncurses-devel \ + && wget https://www.python.org/ftp/python/${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}/Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}.tgz \ + && tar xzf Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}.tgz \ + && cd Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION} \ + && ./configure --prefix=${PYTHON_DIR} \ + --enable-loadable-sqlite-extensions \ + --enable-optimizations \ + --enable-option-checking=fatal \ + --enable-shared \ + --with-system-expat \ + && make -j"$(nproc)" \ + && make install \ + && ldconfig ${PYTHON_DIR}/lib \ + && find ${PYTHON_DIR} -depth \ + \( \ + \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' + + +FROM ${baseImage} as runtime + +ENV PYTHON_DIR=/opt/python +ENV PATH=${PYTHON_DIR}/bin:$PATH +ENV LANG=C.UTF-8 + +ENV PYTHON_VERSION=3.12 +ENV PYTHON_PATCH_VERSION=12 + +COPY --from=build ${PYTHON_DIR} ${PYTHON_DIR} +ENV LD_LIBRARY_PATH=${PYTHON_DIR}/lib:${LD_LIBRARY_PATH} +RUN ldconfig ${PYTHON_DIR}/lib + +# - In order to drop the root user, we have to make some directories world +# writable as OpenShift default security model is to run the container +# under random UID. +RUN chown -R ${USER}:0 ${APP_ROOT} && \ + chmod +x /usr/bin/fix-permissions && \ + fix-permissions ${APP_ROOT} -P && \ + rpm-file-permissions + +USER ${USER} + +RUN python3 -m pip install --upgrade --user pip wheel && \ + find ${APP_ROOT}/.local -type d -exec chmod 0755 {} \; diff --git a/build/Python313/Dockerfile.ubi9 b/build/Python313/Dockerfile.ubi9 new file mode 100644 index 0000000..84b5e66 --- /dev/null +++ b/build/Python313/Dockerfile.ubi9 @@ -0,0 +1,57 @@ +ARG baseImage +FROM ${baseImage} as build + +ENV PYTHON_VERSION=3.13 +ENV PYTHON_PATCH_VERSION=8 + +ENV PYTHON_DIR=/opt/python +ENV PATH=${PYTHON_DIR}/bin:$PATH +ENV LANG=C.UTF-8 + +WORKDIR ${HOME} + +RUN dnf install -y --setopt=tsflags=nodocs \ + gcc openssl-devel bzip2-devel libffi-devel expat-devel make wget cmake git \ + zlib-devel sqlite-devel ncurses-devel \ + && wget https://www.python.org/ftp/python/${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}/Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}.tgz \ + && tar xzf Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}.tgz \ + && cd Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION} \ + && ./configure --prefix=${PYTHON_DIR} \ + --enable-loadable-sqlite-extensions \ + --enable-shared \ + --with-system-expat \ + && make -j"$(nproc)" \ + && make install \ + && ldconfig ${PYTHON_DIR}/lib \ + && find ${PYTHON_DIR} -depth \ + \( \ + \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' + + +FROM ${baseImage} as runtime + +ENV PYTHON_DIR=/opt/python +ENV PATH=${PYTHON_DIR}/bin:$PATH +ENV LANG=C.UTF-8 + +ENV PYTHON_VERSION=3.13 +ENV PYTHON_PATCH_VERSION=8 + +COPY --from=build ${PYTHON_DIR} ${PYTHON_DIR} +ENV LD_LIBRARY_PATH=${PYTHON_DIR}/lib:${LD_LIBRARY_PATH} +RUN ldconfig ${PYTHON_DIR}/lib + +# - In order to drop the root user, we have to make some directories world +# writable as OpenShift default security model is to run the container +# under random UID. +RUN chown -R ${USER}:0 ${APP_ROOT} && \ + chmod +x /usr/bin/fix-permissions && \ + fix-permissions ${APP_ROOT} -P && \ + rpm-file-permissions + +USER ${USER} + +RUN python3 -m pip install --upgrade --user pip wheel && \ + find ${APP_ROOT}/.local -type d -exec chmod 0755 {} \; diff --git a/build/Python38/Dockerfile.ubi8 b/build/Python38/Dockerfile.ubi8 deleted file mode 100644 index d726cd7..0000000 --- a/build/Python38/Dockerfile.ubi8 +++ /dev/null @@ -1,20 +0,0 @@ -ARG baseImage -FROM ${baseImage} - -RUN INSTALL_PKGS="python38 python38-devel python38-setuptools python38-pip gcc diffutils file make gcc-c++ cmake git" && \ - dnf -y module enable python38:3.8 && \ - dnf -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ - rpm -V $INSTALL_PKGS && \ - dnf -y clean all --enablerepo='*' - -# - In order to drop the root user, we have to make some directories world -# writable as OpenShift default security model is to run the container -# under random UID. -RUN chown -R ${USER}:0 ${APP_ROOT} && \ - chmod +x /usr/bin/fix-permissions && \ - fix-permissions ${APP_ROOT} -P && \ - rpm-file-permissions - -USER ${USER} - -RUN python3 -m pip install --upgrade --user pip wheel && find ${APP_ROOT}/.local -type d -exec chmod 0755 {} \; diff --git a/build/Python38/Dockerfile.ubi9 b/build/Python38/Dockerfile.ubi9 index ffcba1c..da7fe83 100644 --- a/build/Python38/Dockerfile.ubi9 +++ b/build/Python38/Dockerfile.ubi9 @@ -1,48 +1,49 @@ ARG baseImage FROM ${baseImage} as build -ENV PYTHON_VERSION 3.8 -ENV PYTHON_PATCH_VERSION 18 -ENV ARCH amd64 +ENV PYTHON_VERSION=3.8 +ENV PYTHON_PATCH_VERSION=18 ENV PYTHON_DIR=/opt/python -ENV PATH ${PYTHON_DIR}/bin:$PATH -ENV LANG C.UTF-8 +ENV PATH=${PYTHON_DIR}/bin:$PATH +ENV LANG=C.UTF-8 WORKDIR ${HOME} -RUN dnf install -y --setopt=tsflags=nodocs gcc openssl-devel bzip2-devel libffi-devel expat-devel make diffutils file gcc-c++ wget cmake git zlib-devel sqlite-devel \ +RUN dnf install -y --setopt=tsflags=nodocs \ + gcc openssl-devel bzip2-devel libffi-devel expat-devel make diffutils file \ + gcc-c++ wget cmake git zlib-devel sqlite-devel \ && wget https://www.python.org/ftp/python/${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}/Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}.tgz \ && tar xzf Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}.tgz \ && cd Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION} \ && ./configure --prefix=${PYTHON_DIR} \ - --build="$ARCH" \ - --enable-loadable-sqlite-extensions \ - --enable-optimizations \ - --enable-option-checking=fatal \ - --enable-shared \ - --with-system-expat \ - --with-system-ffi \ - && make -j "$(nproc)" \ + --enable-loadable-sqlite-extensions \ + --enable-optimizations \ + --enable-option-checking=fatal \ + --enable-shared \ + --with-system-expat \ + --with-system-ffi \ + && make -j"$(nproc)" \ && make install \ && ldconfig ${PYTHON_DIR}/lib \ && find ${PYTHON_DIR} -depth \ - \( \ - \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ - -o \ - \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ - \) -exec rm -rf '{}' + + \( \ + \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' + FROM ${baseImage} as runtime ENV PYTHON_DIR=/opt/python -ENV PATH ${PYTHON_DIR}/bin:$PATH -ENV LANG C.UTF-8 +ENV PATH=${PYTHON_DIR}/bin:$PATH +ENV LANG=C.UTF-8 -ENV PYTHON_VERSION 3.8 -ENV PYTHON_PATCH_VERSION 18 +ENV PYTHON_VERSION=3.8 +ENV PYTHON_PATCH_VERSION=18 COPY --from=build ${PYTHON_DIR} ${PYTHON_DIR} +ENV LD_LIBRARY_PATH=${PYTHON_DIR}/lib:${LD_LIBRARY_PATH} RUN ldconfig ${PYTHON_DIR}/lib # - In order to drop the root user, we have to make some directories world @@ -50,9 +51,10 @@ RUN ldconfig ${PYTHON_DIR}/lib # under random UID. RUN chown -R ${USER}:0 ${APP_ROOT} && \ chmod +x /usr/bin/fix-permissions && \ - fix-permissions ${APP_ROOT} -P && \ - rpm-file-permissions + fix-permissions ${APP_ROOT} -P && \ + rpm-file-permissions USER ${USER} -RUN python3 -m pip install --upgrade --user pip wheel && find ${APP_ROOT}/.local -type d -exec chmod 0755 {} \; \ No newline at end of file +RUN python3 -m pip install --upgrade --user pip wheel && \ + find ${APP_ROOT}/.local -type d -exec chmod 0755 {} \; diff --git a/runtime/Python310/Dockerfile.ubi9 b/runtime/Python310/Dockerfile.ubi9 index e498d89..4a15f90 100644 --- a/runtime/Python310/Dockerfile.ubi9 +++ b/runtime/Python310/Dockerfile.ubi9 @@ -4,44 +4,43 @@ FROM ${baseImage} as build ENV PYTHON_VERSION 3.10 ENV PYTHON_PATCH_VERSION 13 -ENV ARCH amd64 ENV PYTHON_DIR=/opt/python -ENV PATH ${PYTHON_DIR}/bin:$PATH -ENV LANG C.UTF-8 +ENV PATH=${PYTHON_DIR}/bin:$PATH +ENV LANG=C.UTF-8 WORKDIR ${HOME} -RUN microdnf install -y --setopt=tsflags=nodocs gcc openssl-devel bzip2-devel libffi-devel expat-devel make wget tar gzip zlib-devel sqlite-devel \ +RUN microdnf install -y --setopt=tsflags=nodocs \ + gcc openssl-devel bzip2-devel libffi-devel expat-devel make wget tar gzip zlib-devel sqlite-devel \ && wget https://www.python.org/ftp/python/${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}/Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}.tgz \ && tar xzf Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}.tgz \ && cd Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION} \ && ./configure --prefix=${PYTHON_DIR} \ - --build="$ARCH" \ - --enable-loadable-sqlite-extensions \ - --enable-optimizations \ - --enable-option-checking=fatal \ - --enable-shared \ - --with-system-expat \ - --with-system-ffi \ - && make -j "$(nproc)" \ + --enable-loadable-sqlite-extensions \ + --enable-optimizations \ + --enable-option-checking=fatal \ + --enable-shared \ + --with-system-expat \ + --with-system-ffi \ + && make -j"$(nproc)" \ && make install \ && ldconfig ${PYTHON_DIR}/lib \ && find ${PYTHON_DIR} -depth \ - \( \ - \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ - -o \ - \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ - \) -exec rm -rf '{}' + + \( \ + \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' + FROM ${baseImage} as runtime ENV PYTHON_DIR=/opt/python -ENV PATH ${PYTHON_DIR}/bin:$PATH -ENV LANG C.UTF-8 +ENV PATH=${PYTHON_DIR}/bin:$PATH +ENV LANG=C.UTF-8 ENV PYTHON_VERSION 3.10 -ENV PYTHON_PATCH_VERSION 4 +ENV PYTHON_PATCH_VERSION 13 RUN INSTALL_PKGS="expat" && \ microdnf -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ @@ -49,6 +48,7 @@ RUN INSTALL_PKGS="expat" && \ microdnf -y clean all --enablerepo='*' COPY --from=build ${PYTHON_DIR} ${PYTHON_DIR} +ENV LD_LIBRARY_PATH=${PYTHON_DIR}/lib:${LD_LIBRARY_PATH} RUN ldconfig ${PYTHON_DIR}/lib # - In order to drop the root user, we have to make some directories world @@ -59,7 +59,6 @@ RUN chown -R ${USER}:0 ${APP_ROOT} && \ fix-permissions ${APP_ROOT} -P && \ rpm-file-permissions -ENV PYTHONPATH=${PYTHON_DIR}/.local/lib64/python3.8/site-packages - +ENV PYTHONPATH=${PYTHON_DIR}/lib/python3.10/site-packages -USER ${USER} \ No newline at end of file +USER ${USER} diff --git a/runtime/Python311/Dockerfile.ubi9 b/runtime/Python311/Dockerfile.ubi9 index b6fb9b6..3340096 100644 --- a/runtime/Python311/Dockerfile.ubi9 +++ b/runtime/Python311/Dockerfile.ubi9 @@ -3,45 +3,45 @@ ARG baseImage FROM ${baseImage} as build ENV PYTHON_VERSION 3.11 -ENV PYTHON_PATCH_VERSION 13 -ENV ARCH amd64 +ENV PYTHON_PATCH_VERSION 14 ENV PYTHON_DIR=/opt/python -ENV PATH ${PYTHON_DIR}/bin:$PATH -ENV LANG C.UTF-8 +ENV PATH=${PYTHON_DIR}/bin:$PATH +ENV LANG=C.UTF-8 WORKDIR ${HOME} -RUN microdnf install -y --setopt=tsflags=nodocs gcc openssl-devel bzip2-devel libffi-devel expat-devel make wget tar gzip zlib-devel sqlite-devel ncurses-devel xz xz-devel \ +RUN microdnf install -y --setopt=tsflags=nodocs \ + gcc openssl-devel bzip2-devel libffi-devel expat-devel make wget tar gzip \ + zlib-devel sqlite-devel ncurses-devel xz xz-devel \ && wget https://www.python.org/ftp/python/${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}/Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}.tgz \ && tar xzf Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}.tgz \ && cd Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION} \ && ./configure --prefix=${PYTHON_DIR} \ - --build="$ARCH" \ - --enable-loadable-sqlite-extensions \ - --enable-optimizations \ - --enable-option-checking=fatal \ - --enable-shared \ - --with-system-expat \ - --with-system-ffi \ - && make -j "$(nproc)" \ + --enable-loadable-sqlite-extensions \ + --enable-optimizations \ + --enable-option-checking=fatal \ + --enable-shared \ + --with-system-expat \ + --with-system-ffi \ + && make -j"$(nproc)" \ && make install \ && ldconfig ${PYTHON_DIR}/lib \ && find ${PYTHON_DIR} -depth \ - \( \ - \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ - -o \ - \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ - \) -exec rm -rf '{}' + + \( \ + \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' + FROM ${baseImage} as runtime ENV PYTHON_DIR=/opt/python -ENV PATH ${PYTHON_DIR}/bin:$PATH -ENV LANG C.UTF-8 +ENV PATH=${PYTHON_DIR}/bin:$PATH +ENV LANG=C.UTF-8 ENV PYTHON_VERSION 3.11 -ENV PYTHON_PATCH_VERSION 13 +ENV PYTHON_PATCH_VERSION 14 RUN INSTALL_PKGS="expat" && \ microdnf -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ @@ -49,7 +49,7 @@ RUN INSTALL_PKGS="expat" && \ microdnf -y clean all --enablerepo='*' COPY --from=build ${PYTHON_DIR} ${PYTHON_DIR} -ENV LD_LIBRARY_PATH ${PYTHON_DIR}/lib:{LD_LIBRARY_PATH} +ENV LD_LIBRARY_PATH=${PYTHON_DIR}/lib:${LD_LIBRARY_PATH} RUN ldconfig ${PYTHON_DIR}/lib # - In order to drop the root user, we have to make some directories world @@ -62,4 +62,4 @@ RUN chown -R ${USER}:0 ${APP_ROOT} && \ ENV PYTHONPATH=${PYTHON_DIR}/lib/python3.11/site-packages -USER ${USER} \ No newline at end of file +USER ${USER} diff --git a/runtime/Python312/Dockerfile.ubi9 b/runtime/Python312/Dockerfile.ubi9 new file mode 100644 index 0000000..003ca00 --- /dev/null +++ b/runtime/Python312/Dockerfile.ubi9 @@ -0,0 +1,64 @@ +ARG baseImage + +FROM ${baseImage} as build + +ENV PYTHON_VERSION 3.12 +ENV PYTHON_PATCH_VERSION 12 + +ENV PYTHON_DIR=/opt/python +ENV PATH=${PYTHON_DIR}/bin:$PATH +ENV LANG=C.UTF-8 + +WORKDIR ${HOME} + +RUN microdnf install -y --setopt=tsflags=nodocs \ + gcc openssl-devel bzip2-devel libffi-devel expat-devel make wget tar gzip \ + zlib-devel sqlite-devel ncurses-devel xz xz-devel \ + && wget https://www.python.org/ftp/python/${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}/Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}.tgz \ + && tar xzf Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}.tgz \ + && cd Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION} \ + && ./configure --prefix=${PYTHON_DIR} \ + --enable-loadable-sqlite-extensions \ + --enable-optimizations \ + --enable-option-checking=fatal \ + --enable-shared \ + --with-system-expat \ + && make -j"$(nproc)" \ + && make install \ + && ldconfig ${PYTHON_DIR}/lib \ + && find ${PYTHON_DIR} -depth \ + \( \ + \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' + + +FROM ${baseImage} as runtime + +ENV PYTHON_DIR=/opt/python +ENV PATH=${PYTHON_DIR}/bin:$PATH +ENV LANG=C.UTF-8 + +ENV PYTHON_VERSION 3.12 +ENV PYTHON_PATCH_VERSION 12 + +RUN INSTALL_PKGS="expat" && \ + microdnf -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ + rpm -V $INSTALL_PKGS && \ + microdnf -y clean all --enablerepo='*' + +COPY --from=build ${PYTHON_DIR} ${PYTHON_DIR} +ENV LD_LIBRARY_PATH=${PYTHON_DIR}/lib:${LD_LIBRARY_PATH} +RUN ldconfig ${PYTHON_DIR}/lib + +# - In order to drop the root user, we have to make some directories world +# writable as OpenShift default security model is to run the container +# under random UID. +RUN chown -R ${USER}:0 ${APP_ROOT} && \ + chmod +x /usr/bin/fix-permissions && \ + fix-permissions ${APP_ROOT} -P && \ + rpm-file-permissions + +ENV PYTHONPATH=${PYTHON_DIR}/lib/python3.12/site-packages + +USER ${USER} diff --git a/runtime/Python310/Dockerfile.ubi8 b/runtime/Python313/Dockerfile.ubi9 similarity index 54% rename from runtime/Python310/Dockerfile.ubi8 rename to runtime/Python313/Dockerfile.ubi9 index eccb8d1..6c546cb 100644 --- a/runtime/Python310/Dockerfile.ubi8 +++ b/runtime/Python313/Dockerfile.ubi9 @@ -1,46 +1,44 @@ ARG baseImage + FROM ${baseImage} as build -ENV PYTHON_VERSION 3.10 -ENV PYTHON_PATCH_VERSION 4 -ENV ARCH amd64 +ENV PYTHON_VERSION 3.13 +ENV PYTHON_PATCH_VERSION 8 ENV PYTHON_DIR=/opt/python -ENV PATH ${PYTHON_DIR}/bin:$PATH -ENV LANG C.UTF-8 +ENV PATH=${PYTHON_DIR}/bin:$PATH +ENV LANG=C.UTF-8 WORKDIR ${HOME} -RUN microdnf install -y --setopt=tsflags=nodocs gcc openssl-devel bzip2-devel libffi-devel expat-devel make wget tar gzip \ +RUN microdnf install -y --setopt=tsflags=nodocs \ + gcc openssl-devel bzip2-devel libffi-devel expat-devel make wget tar gzip \ + zlib-devel sqlite-devel ncurses-devel xz xz-devel \ && wget https://www.python.org/ftp/python/${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}/Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}.tgz \ && tar xzf Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}.tgz \ && cd Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION} \ && ./configure --prefix=${PYTHON_DIR} \ - --build="$ARCH" \ - --enable-loadable-sqlite-extensions \ - --enable-optimizations \ - --enable-option-checking=fatal \ - --enable-shared \ - --with-system-expat \ - --with-system-ffi \ - && make -j "$(nproc)" \ + --enable-loadable-sqlite-extensions \ + --enable-shared \ + --with-system-expat \ + && make -j"$(nproc)" \ && make install \ && ldconfig ${PYTHON_DIR}/lib \ && find ${PYTHON_DIR} -depth \ - \( \ - \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ - -o \ - \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ - \) -exec rm -rf '{}' + + \( \ + \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' + FROM ${baseImage} as runtime ENV PYTHON_DIR=/opt/python -ENV PATH ${PYTHON_DIR}/bin:$PATH -ENV LANG C.UTF-8 +ENV PATH=${PYTHON_DIR}/bin:$PATH +ENV LANG=C.UTF-8 -ENV PYTHON_VERSION 3.10 -ENV PYTHON_PATCH_VERSION 4 +ENV PYTHON_VERSION 3.13 +ENV PYTHON_PATCH_VERSION 8 RUN INSTALL_PKGS="expat" && \ microdnf -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ @@ -48,17 +46,17 @@ RUN INSTALL_PKGS="expat" && \ microdnf -y clean all --enablerepo='*' COPY --from=build ${PYTHON_DIR} ${PYTHON_DIR} +ENV LD_LIBRARY_PATH=${PYTHON_DIR}/lib:${LD_LIBRARY_PATH} RUN ldconfig ${PYTHON_DIR}/lib # - In order to drop the root user, we have to make some directories world # writable as OpenShift default security model is to run the container # under random UID. RUN chown -R ${USER}:0 ${APP_ROOT} && \ - chmod +x /usr/bin/fix-permissions && \ + chmod +x /usr/bin/fix-permissions && \ fix-permissions ${APP_ROOT} -P && \ rpm-file-permissions -ENV PYTHONPATH=${PYTHON_DIR}/.local/lib64/python3.8/site-packages - +ENV PYTHONPATH=${PYTHON_DIR}/lib/python3.13/site-packages -USER ${USER} \ No newline at end of file +USER ${USER} diff --git a/runtime/Python38/Dockerfile.ubi8 b/runtime/Python38/Dockerfile.ubi8 deleted file mode 100644 index aaef808..0000000 --- a/runtime/Python38/Dockerfile.ubi8 +++ /dev/null @@ -1,21 +0,0 @@ -ARG baseImage -FROM ${baseImage} - -RUN INSTALL_PKGS="python38" && \ - microdnf -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ - rpm -V $INSTALL_PKGS && \ - microdnf -y clean all --enablerepo='*' - -RUN python3 -m pip install --upgrade pip - -# - In order to drop the root user, we have to make some directories world -# writable as OpenShift default security model is to run the container -# under random UID. -RUN chown -R ${USER}:0 ${APP_ROOT} && \ - chmod +x /usr/bin/fix-permissions && \ - fix-permissions ${APP_ROOT} -P && \ - rpm-file-permissions - -ENV PYTHONPATH=${APP_ROOT}/.local/lib64/python3.8/site-packages - -USER ${USER} \ No newline at end of file diff --git a/runtime/Python38/Dockerfile.ubi9 b/runtime/Python38/Dockerfile.ubi9 index c5e70ee..742b8d4 100644 --- a/runtime/Python38/Dockerfile.ubi9 +++ b/runtime/Python38/Dockerfile.ubi9 @@ -4,41 +4,40 @@ FROM ${baseImage} as build ENV PYTHON_VERSION 3.8 ENV PYTHON_PATCH_VERSION 18 -ENV ARCH amd64 ENV PYTHON_DIR=/opt/python -ENV PATH ${PYTHON_DIR}/bin:$PATH -ENV LANG C.UTF-8 +ENV PATH=${PYTHON_DIR}/bin:$PATH +ENV LANG=C.UTF-8 WORKDIR ${HOME} -RUN microdnf install -y --setopt=tsflags=nodocs gcc openssl-devel bzip2-devel libffi-devel expat-devel make wget tar gzip zlib-devel sqlite-devel \ +RUN microdnf install -y --setopt=tsflags=nodocs \ + gcc openssl-devel bzip2-devel libffi-devel expat-devel make wget tar gzip zlib-devel sqlite-devel \ && wget https://www.python.org/ftp/python/${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}/Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}.tgz \ && tar xzf Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION}.tgz \ && cd Python-${PYTHON_VERSION}.${PYTHON_PATCH_VERSION} \ && ./configure --prefix=${PYTHON_DIR} \ - --build="$ARCH" \ - --enable-loadable-sqlite-extensions \ - --enable-optimizations \ - --enable-option-checking=fatal \ - --enable-shared \ - --with-system-expat \ - --with-system-ffi \ - && make -j "$(nproc)" \ + --enable-loadable-sqlite-extensions \ + --enable-optimizations \ + --enable-option-checking=fatal \ + --enable-shared \ + --with-system-expat \ + --with-system-ffi \ + && make -j"$(nproc)" \ && make install \ && ldconfig ${PYTHON_DIR}/lib \ && find ${PYTHON_DIR} -depth \ - \( \ - \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ - -o \ - \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ - \) -exec rm -rf '{}' + + \( \ + \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' + FROM ${baseImage} as runtime ENV PYTHON_DIR=/opt/python -ENV PATH ${PYTHON_DIR}/bin:$PATH -ENV LANG C.UTF-8 +ENV PATH=${PYTHON_DIR}/bin:$PATH +ENV LANG=C.UTF-8 ENV PYTHON_VERSION 3.8 ENV PYTHON_PATCH_VERSION 18 @@ -49,6 +48,7 @@ RUN INSTALL_PKGS="expat" && \ microdnf -y clean all --enablerepo='*' COPY --from=build ${PYTHON_DIR} ${PYTHON_DIR} +ENV LD_LIBRARY_PATH=${PYTHON_DIR}/lib:${LD_LIBRARY_PATH} RUN ldconfig ${PYTHON_DIR}/lib # - In order to drop the root user, we have to make some directories world @@ -59,7 +59,6 @@ RUN chown -R ${USER}:0 ${APP_ROOT} && \ fix-permissions ${APP_ROOT} -P && \ rpm-file-permissions -ENV PYTHONPATH=${PYTHON_DIR}/.local/lib64/python3.8/site-packages +ENV PYTHONPATH=${PYTHON_DIR}/lib/python3.8/site-packages - -USER ${USER} \ No newline at end of file +USER ${USER}