Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by gbr-app-1.alpinelinux.org (Postfix) with ESMTPS id 433902236CB for <~alpine/users@lists.alpinelinux.org>; Wed, 1 Feb 2023 14:04:03 +0000 (UTC) Received: by mail-lj1-x235.google.com with SMTP id b13so9556296ljf.8 for <~alpine/users@lists.alpinelinux.org>; Wed, 01 Feb 2023 06:04:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bell-sw-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=H19t6hsMnpuDZUQNvnCpou4et0r0DfeZ1FIvtDcpwcU=; b=iLEFy37wBZwocizxnrMm7CuS5np/kCYgWZ9met97O3K3S8AW7wlY3fC//fS4J9GDfU LJ5gLy9WX418+OBPF8X+k5veuPoUEw2M50vmaVQA/rnxMMjL3meepdXqKmJfpnpqFfsf 9wlYEljCDp/SwG8DqjdEgW1QRM2EW6SImOrW2OIY12NDrFROpsou7k+zsKhvhO40rLAF T+SF0lm0c4e+IsWA//0Q8WnWkW8W/xOxanahVP04/XGHu5lQbRMCQYk0GGV13BG91zwc YeadxZMeVMOP/g+NALNMnyPV5JX4ngn36RHO2Hx0FQm2Ltt5qqYtvqFte+GNp4Yf6lvM T4ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=H19t6hsMnpuDZUQNvnCpou4et0r0DfeZ1FIvtDcpwcU=; b=J05xZ0MU3OjkAm4tRMba1cRhjQfzXFJ7ColjZZgF1BZyI0pQkEbge5ybbJH0UB7SJh kEXYf99U4Ec5izN0rkBTT2NEJ0Qk2brY+3YNWEjV7Jr5Ij1RVLrf2/rM8aUBCoMIO7Ra oVyih9pp03gG+r8gmMn37p0j9Mmex7DHUG7IK0Chuq5GWabuFGYIFSXZ7Dpn5c/MNR4L FuNaOneC6ANqbirJZROnwAn+RY6HioW5kbWwCBXb+uUvIWwnq6xnG3k7k2M8LHeFpL5e bfHJeXtwcf7+Qp4kfWAjAJaAdturgrfOfFLEVJvP2w+wea/R/D06BJYjF7Ag5MBiHgze e/rA== X-Gm-Message-State: AO0yUKVTW5Uw/daKktG4tZZS8LR3aLv6Ri8UT4IA6n0J0575nQQWGMMM xorAqUsPPC+uYFqEuERhkmSeT7l04KYkwL61 X-Google-Smtp-Source: AK7set+csLceO08s+YU/lHqF225mQAcJyQvBa2cSwOkj+vdDM30tFsLyUe57NvdHmTVg3DupNbrLMw== X-Received: by 2002:a2e:3304:0:b0:290:6f87:bfa4 with SMTP id d4-20020a2e3304000000b002906f87bfa4mr526106ljc.5.1675260242105; Wed, 01 Feb 2023 06:04:02 -0800 (PST) Received: from [192.168.88.231] ([37.153.11.115]) by smtp.gmail.com with ESMTPSA id v17-20020a2ea451000000b002778a9b0c34sm1073918ljn.45.2023.02.01.06.03.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Feb 2023 06:04:00 -0800 (PST) Message-ID: Date: Wed, 1 Feb 2023 17:03:36 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: Font dependencies in Alpine Linux Content-Language: en-US To: alice , ~alpine/users@lists.alpinelinux.org References: <59c4dca8-5cd0-1a7f-043f-924448927ece@bell-sw.com> <469f059e-969c-444b-6cd3-4b7646e63f77@bell-sw.com> From: Alexander Scherbatiy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2/1/23 16:21, alice wrote: > On Wed Feb 1, 2023 at 2:12 PM CET, Alexander Scherbatiy wrote: >> On 2/1/23 15:38, alice wrote: >> >>> On Wed Feb 1, 2023 at 12:43 PM CET, Alexander Scherbatiy wrote: >>>> Hello, >>>> >>>> If I install dejavu fonts on systems ubuntu:20.04, fedora:35, >>>> opensuse/leap:15.4 in docker they do not install fontconfig and freetype >>>> as dependencies. >>>> >>>> DejaVu fonts have dependencies on fontconfig and freetype libraries on >>>> Linux Alpine . >>>> >>>> --------- >>>> >>>> docker run -it alpine:3.17 ash >>>> / # apk update >>>> / # apk add font-dejavu >>>> (1/10) Installing libexpat (2.5.0-r0) >>>> (2/10) Installing brotli-libs (1.0.9-r9) >>>> (3/10) Installing libbz2 (1.0.8-r4) >>>> (4/10) Installing libpng (1.6.38-r0) >>>> (5/10) Installing freetype (2.12.1-r0) >>>> (6/10) Installing fontconfig (2.14.1-r0) >>>> (7/10) Installing encodings (1.0.6-r0) >>>> (8/10) Installing libfontenc (1.1.6-r0) >>>> (9/10) Installing mkfontscale (1.2.2-r1) >>>> (10/10) Installing font-dejavu (2.37-r3) >>>> Executing busybox-1.35.0-r29.trigger >>>> Executing fontconfig-2.14.1-r0.trigger >>>> Executing mkfontscale-1.2.2-r1.trigger >>>> OK: 28 MiB in 25 packages >>>> --------- >>>> >>>> The use case which I have is using a docker with Linux Alpine to >>>> generate reports with Java in headless mode. >>>> Java allows to use fonts on systems where the fontconfig is not >>>> installed by providing paths to fonts in /lib/fontconfig.properties >>>> file. >>>> Java also can be built with bundled freetype which is a subset of the >>>> full freetype library. >>> freetype is merely a dependency of fontconfig in this case >>> >>>> Is it necessary that fonts have dependencies on fontconfig and freetype >>>> libraries in Alpine Linux? >>> yes, as normally using the fonts generally requires it. >>> >>> i suppose it's not impossible to not depend on it paired with any fonts >>> directly, but strictly speaking there is generally no difference, except in >>> your special usecase. you'd probably say the same goes for mkfontscale? >>   Yes. The general question is that fonts on Alpine Linux has more >> dependencies than fonts on other systems. >>   For example, if I use ubuntu:20.04, dejavu fonts depend only on >> fonts-dejavu-core and fonts-dejavu-extra >> >>  --------- >>  docker run -it ubuntu:20.04 bash >>  apt update >>  apt install fonts-dejavu >> Reading package lists... Done >> Building dependency tree >> Reading state information... Done >> The following additional packages will be installed: >>   fonts-dejavu-core fonts-dejavu-extra >> The following NEW packages will be installed: >>   fonts-dejavu fonts-dejavu-core fonts-dejavu-extra >> 0 upgraded, 3 newly installed, 0 to remove and 4 not upgraded. >> Need to get 2996 kB of archives. >> After this operation, 10.5 MB of additional disk space will be used. >> --------- >> >> >> The aim is to use a docker image with Java as small as possible. >> >> What is the right way to setup Alpine Linux docker with fonts and >> without additional dependencies for my use case? >> My be fonts can be just copied during docker image creation instead of >> just font installation from packages? > merely dropping the dependencies could be looked at by someone if they wanted, > i don't have the energy currently , but for your usecase: > > - exactly that, just copy what you want. > - use: > > $ apk add -t mkfontscale > $ apk add -t fontconfig > (note individual commands with nothing else) > > this is a hack(!) that creates a virtual package with no dependencies with a > pkgver of the current date, so it will then uninstall the real ones that exist > (since the dependency is satisfied via name only, and this virtual has the > highest version). you end up with no dependencies.   Thank you. This works for my case. > >> Thanks, >> Alexander. >> >>>> Thanks, >>>> Alexander.