From c8a5361d1b25f39e391aa7c637503266cad4d537 Mon Sep 17 00:00:00 2001 From: aman-17 Date: Fri, 6 Jun 2025 13:50:12 -0700 Subject: [PATCH] fixing packages of 22.04 --- Dockerfile | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 452f88e..2ce2b18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,25 +16,26 @@ add-apt-repository -y ppa:deadsnakes/ppa && break || \ { echo "Attempt $i failed, retrying in 5s..."; sleep 5; }; \ done \ && apt-get update -y \ -&& apt-get install -y python${PYTHON_VERSION} python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-venv \ -&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1 \ +&& apt-get install -y python${PYTHON_VERSION} python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-venv + +# olmOCR Specific Installs - Install fonts BEFORE changing Python version +RUN echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections && \ +apt-get update -y && \ +apt-get install -y --no-install-recommends poppler-utils fonts-crosextra-caladea fonts-crosextra-carlito gsfonts lcdf-typetools ttf-mscorefonts-installer + +# Now update Python alternatives +RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1 \ && update-alternatives --set python3 /usr/bin/python${PYTHON_VERSION} \ && update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 \ && update-alternatives --set python /usr/bin/python${PYTHON_VERSION} \ && ln -sf /usr/bin/python${PYTHON_VERSION}-config /usr/bin/python3-config \ && curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION} \ && python3 --version && python3 -m pip --version + # Install uv for faster pip installs RUN --mount=type=cache,target=/root/.cache/uv \ python3 -m pip install uv -# olmOCR Specific Installs -# Install fonts with fix for Python apt module -RUN echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections && \ -apt-get update -y && \ -# First install python3-apt for the system Python (3.10) that update-notifier-common needs -apt-get install -y python3-apt && \ -# Now install the fonts and other packages -apt-get install -y --no-install-recommends poppler-utils fonts-crosextra-caladea fonts-crosextra-carlito gsfonts lcdf-typetools ttf-mscorefonts-installer + # Install some helper utilities for things like the benchmark RUN apt-get update -y && apt-get install -y --no-install-recommends \ git \