From b13570f2217804754b4edf0aaed3d8d4128910d9 Mon Sep 17 00:00:00 2001 From: Vladimir Ischenko Date: Tue, 11 Nov 2025 15:10:51 +0300 Subject: [PATCH] Add msfonts caching to avoid install issues --- .github/workflows/4testing-build.yml | 16 ++++++++++++++++ Dockerfile | 3 ++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/4testing-build.yml b/.github/workflows/4testing-build.yml index b38a5d8..ab6a01c 100644 --- a/.github/workflows/4testing-build.yml +++ b/.github/workflows/4testing-build.yml @@ -106,6 +106,22 @@ jobs: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + - name: Prepare fonts cache + id: fonts + uses: actions/cache@v4 + with: + path: fonts + key: fonts-${{ runner.os }}-v1 + + - name: Install fonts if not cached + if: steps.fonts.outputs.cache-hit != 'true' + run: | + sudo apt-get update + echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | sudo debconf-set-selections + sudo apt-get install -y ttf-mscorefonts-installer + mkdir -p fonts/msttcorefonts + cp -a /usr/share/fonts/truetype/msttcorefonts/* fonts/msttcorefonts/ + - name: Build 4testing id: build-ds env: diff --git a/Dockerfile b/Dockerfile index f4e6be9..d7bdb34 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,6 +22,7 @@ ENV OC_DOWNLOAD_URL=https://download.oracle.com/otn_software/linux/instantclient ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive PG_VERSION=${PG_VERSION} BASE_VERSION=${BASE_VERSION} ARG ONLYOFFICE_VALUE=onlyoffice +COPY fonts/ /usr/share/fonts/truetype/ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ apt-get -y update && \ @@ -74,7 +75,7 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ xxd \ zlib1g || dpkg --configure -a && \ # Added dpkg --configure -a to handle installation issues with rabbitmq-server on arm64 architecture - if [ $(ls -l /usr/share/fonts/truetype/msttcorefonts | wc -l) -ne 61 ]; \ + if [ $(find /usr/share/fonts/truetype/msttcorefonts -maxdepth 1 -type f -iname '*.ttf' | wc -l) -lt 30 ]; \ then echo 'msttcorefonts failed to download'; exit 1; fi && \ echo "SERVER_ADDITIONAL_ERL_ARGS=\"+S 1:1\"" | tee -a /etc/rabbitmq/rabbitmq-env.conf && \ sed -i "s/bind .*/bind 127.0.0.1/g" /etc/redis/redis.conf && \