diff --git a/py-pagexml/README.rst b/py-pagexml/README.rst index d999a99..a8cee30 100644 --- a/py-pagexml/README.rst +++ b/py-pagexml/README.rst @@ -64,6 +64,11 @@ Normal (in addition to the previous): - libopencv-imgproc4.5d - libopencv-core4.5d - libgdal30 + - Ubuntu 24.04 + - libopencv-imgcodecs406t64 + - libopencv-imgproc406t64 + - libopencv-core406t64 + - libgdal34t64 Building dependencies ~~~~~~~~~~~~~~~~~~~~~ diff --git a/py-pagexml/docker/Dockerfile_build b/py-pagexml/docker/Dockerfile_build index b5c4948..0a85023 100644 --- a/py-pagexml/docker/Dockerfile_build +++ b/py-pagexml/docker/Dockerfile_build @@ -39,12 +39,11 @@ RUN apt-get update --fix-missing \ && if [ -f /usr/lib/x86_64-linux-gnu/pkgconfig/opencv4.pc ]; then \ ln -s opencv4.pc /usr/lib/x86_64-linux-gnu/pkgconfig/opencv.pc; \ fi \ - && pip3 install --upgrade pip setuptools \ && apt-get autoremove -y \ && apt-get purge -y $(dpkg -l | awk '{if($1=="rc")print $2}') \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* -#RUN useradd -m -u 1234 pagexml-build -#WORKDIR /home/pagexml-build -#USER 1234 +RUN useradd -m -u 1234 pagexml-build +WORKDIR /home/pagexml-build +USER 1234 diff --git a/py-pagexml/docker/Dockerfile_build_manylinux.sh b/py-pagexml/docker/Dockerfile_build_manylinux.sh new file mode 100755 index 0000000..d00abec --- /dev/null +++ b/py-pagexml/docker/Dockerfile_build_manylinux.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +WD=$(cd .. && pwd) +IMAGE=quay.io/pypa/manylinux_2_28_x86_64:latest +PY=313 + +docker run \ + --rm \ + -t \ + --env HOME=/tmp \ + --user $(id -u):$(id -g) \ + --workdir "$WD" \ + --volume $HOME:$HOME \ + --entrypoint bash \ + $IMAGE \ + -c " + set -e + /opt/python/cp$PY-cp$PY/bin/pip install setuptools pkgconfig + /opt/python/cp$PY-cp$PY/bin/python setup.py bdist_wheel --slim + auditwheel repair dist/pagexml_slim-*-cp$PY-cp$PY-linux_x86_64.whl + /opt/python/cp$PY-cp$PY/bin/pip install wheelhouse/pagexml_slim-*-cp$PY-cp$PY-manylinux*.whl + /opt/python/cp$PY-cp$PY/bin/python -m pagexml_tests + " diff --git a/py-pagexml/docker/Dockerfile_runtime b/py-pagexml/docker/Dockerfile_runtime index 0c6e719..75ca344 100644 --- a/py-pagexml/docker/Dockerfile_runtime +++ b/py-pagexml/docker/Dockerfile_runtime @@ -10,21 +10,18 @@ ENV \ LC_ALL=C.UTF-8 -ARG PYTHON_VERSION=3 - -RUN if ! test -n "$PYTHON_VERSION"; then \ - echo "error: PYTHON_VERSION argument is required"; \ - exit 1; \ - fi \ - && . /etc/os-release \ - && if [ "$VERSION_ID" = "20.04" ] && [ "$PYTHON_VERSION" = "3" ]; then \ +RUN . /etc/os-release \ + && if [ "$VERSION_ID" = "20.04" ]; then \ CV_VERSION=4.2; \ GDAL_VERSION=26; \ - elif [ "$VERSION_ID" = "22.04" ] && [ "$PYTHON_VERSION" = "3" ]; then \ + elif [ "$VERSION_ID" = "22.04" ]; then \ CV_VERSION=4.5d; \ GDAL_VERSION=30; \ + elif [ "$VERSION_ID" = "24.04" ]; then \ + CV_VERSION=406t64; \ + GDAL_VERSION=34t64; \ else \ - echo "error: unsupported combination UBUNTU=$VERSION_ID PYTHON=$PYTHON_VERSION"; \ + echo "error: unsupported UBUNTU=$VERSION_ID"; \ exit 1; \ fi \ && apt-get update --fix-missing \ @@ -34,16 +31,15 @@ RUN if ! test -n "$PYTHON_VERSION"; then \ nano \ curl \ ca-certificates \ - python$PYTHON_VERSION \ - python$PYTHON_VERSION-pip \ + python3 \ + python3-pip \ + python3-setuptools \ + python3-wheel \ virtualenv \ libopencv-imgproc$CV_VERSION \ libopencv-imgcodecs$CV_VERSION \ libopencv-core$CV_VERSION \ libgdal$GDAL_VERSION \ - && pip3 install --upgrade pip setuptools wheel \ - && apt-get purge -y \ - python$PYTHON_VERSION-pip \ && apt-get autoremove -y \ && apt-get purge -y $(dpkg -l | awk '{if($1=="rc")print $2}') \ && apt-get clean \ @@ -59,6 +55,7 @@ RUN if ! test -n "$PAGEXML_VERSION"; then \ && pip3 install \ --no-cache-dir \ --root-user-action=ignore \ + --break-system-packages \ --progress-bar=off \ --index-url=https://pypi.omnius.com \ --trusted-host=pypi.omnius.com \ diff --git a/py-pagexml/docker/Dockerfile_runtime.sh b/py-pagexml/docker/Dockerfile_runtime.sh index 8035765..8b9f8fe 100755 --- a/py-pagexml/docker/Dockerfile_runtime.sh +++ b/py-pagexml/docker/Dockerfile_runtime.sh @@ -5,28 +5,21 @@ PAGEXML_VERSION=2022.04.12 docker build \ -f Dockerfile_runtime \ - -t mauvilsa/pagexml:runtime-ubuntu16.04-py35 \ - --build-arg UBUNTU_TAG=16.04 \ - --build-arg PAGEXML_VERSION=$PAGEXML_VERSION \ - . - -docker build \ - -f Dockerfile_runtime \ - -t mauvilsa/pagexml:runtime-ubuntu18.04-py36 \ - --build-arg UBUNTU_TAG=18.04 \ + -t mauvilsa/pagexml:runtime-ubuntu20.04-py38 \ + --build-arg UBUNTU_TAG=20.04 \ --build-arg PAGEXML_VERSION=$PAGEXML_VERSION \ . docker build \ -f Dockerfile_runtime \ - -t mauvilsa/pagexml:runtime-ubuntu20.04-py38 \ - --build-arg UBUNTU_TAG=20.04 \ + -t mauvilsa/pagexml:runtime-ubuntu22.04-py310 \ + --build-arg UBUNTU_TAG=22.04 \ --build-arg PAGEXML_VERSION=$PAGEXML_VERSION \ . docker build \ -f Dockerfile_runtime \ - -t mauvilsa/pagexml:runtime-ubuntu22.04-py310 \ - --build-arg UBUNTU_TAG=22.04 \ + -t mauvilsa/pagexml:runtime-ubuntu24.04-py312 \ + --build-arg UBUNTU_TAG=24.04 \ --build-arg PAGEXML_VERSION=$PAGEXML_VERSION \ .