You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your application may have additional requirements.
35
-
For example, if you have an application that requires `libfreetype.so`, you need to copy the native libraries to the container.
36
-
In this case, you need to use a multi-stage `dockerfile` to copy the required libraries:
35
+
For example, if you have an application that manipulates graphics, images, or PDFs, you likely have Quarkus AWT extension included in the project and your native executable will require some additional libraries to run.
36
+
In this case, you need to use a multi-stage `dockerfile` to copy the required libraries.
37
37
38
-
[source, dockerfile]
39
-
----
40
-
# First stage - install the dependencies in an intermediate container
41
-
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.6 as BUILD
Copying handpicked libraries makes up for a small container image, yet it is somewhat britte, differs for different base image versions, and it is a subject to change as transitive dependencies of these libraries might change.
41
+
====
57
42
58
-
If you need to have access to the full AWT support, you need more than just `libfreetype.so`, but also the font and font configurations:
43
+
[NOTE]
44
+
====
45
+
Headless graphics, PDF documents, QR code images etc. manipulation is natively supported on amd64/aarch64 Linux only. Neither Windows nor MacOS are supported and require running the application in a Linux container.
46
+
====
59
47
60
48
[source, dockerfile]
61
49
----
62
50
# First stage - install the dependencies in an intermediate container
63
-
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.6 as BUILD
64
-
RUN microdnf install freetype fontconfig -y
51
+
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.6 as nativelibs
If the micro image does not suit your requirements, you can use https://catalog.redhat.com/software/containers/ubi9-minimal/61832888c0d15aff4912fe0d[ubi9-minimal].
105
104
It's a bigger image, but contains more utilities and is closer to a full Linux distribution.
106
105
Typically, it contains a package manager (`microdnf`), so you can install packages more easily.
To make documents processing, graphics, PDFs, etc. available for the application, you can install the required libraries using `microdnf` without manually copying anything:
125
+
126
+
[source, dockerfile]
127
+
----
128
+
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.6
129
+
RUN microdnf install -y freetype fontconfig \
130
+
&& microdnf clean all
131
+
132
+
WORKDIR /work/
133
+
RUN chown 1001 /work \
134
+
&& chmod "g+rwX" /work \
135
+
&& chown 1001:root /work
136
+
# Shared objects to be dynamically loaded at runtime as needed
0 commit comments