~alpine/users

4 2

Font dependencies in Alpine Linux

Alexander Scherbatiy <alexander.scherbatiy@bell-sw.com>
Details
Message ID
<59c4dca8-5cd0-1a7f-043f-924448927ece@bell-sw.com>
DKIM signature
missing
Download raw message
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 <jdk>/lib/fontconfig.properties 
file.
Java also can be built with bundled freetype which is a subset of the 
full freetype library.


Is it necessary that fonts have dependencies on fontconfig and freetype 
libraries in Alpine Linux?

Thanks,
Alexander.
Details
Message ID
<CQ78DPVFZPDS.MM1J87Q3O1JU@sumire>
In-Reply-To
<59c4dca8-5cd0-1a7f-043f-924448927ece@bell-sw.com> (view parent)
DKIM signature
missing
Download raw message
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 <jdk>/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?

>
> Thanks,
> Alexander.
Alexander Scherbatiy <alexander.scherbatiy@bell-sw.com>
Details
Message ID
<469f059e-969c-444b-6cd3-4b7646e63f77@bell-sw.com>
In-Reply-To
<CQ78DPVFZPDS.MM1J87Q3O1JU@sumire> (view parent)
DKIM signature
missing
Download raw message
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 <jdk>/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?

Thanks,
Alexander.

>
>> Thanks,
>> Alexander.
Details
Message ID
<CQ79ANMILIMJ.EHNIIC517UF1@sumire>
In-Reply-To
<469f059e-969c-444b-6cd3-4b7646e63f77@bell-sw.com> (view parent)
DKIM signature
missing
Download raw message
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 <jdk>/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.

>
> Thanks,
> Alexander.
>
> >
> >> Thanks,
> >> Alexander.
Alexander Scherbatiy <alexander.scherbatiy@bell-sw.com>
Details
Message ID
<d78485b5-46c3-a67f-eb5f-326ef8dc3848@bell-sw.com>
In-Reply-To
<CQ79ANMILIMJ.EHNIIC517UF1@sumire> (view parent)
DKIM signature
missing
Download raw message
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 <jdk>/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.
Reply to thread Export thread (mbox)