Comments (9)
@karianna for me, documentation is enough
from openjdk-docker.
Now all is working, thx for your help
from openjdk-docker.
@floriankoch The distroless images likely do not contain the font packages. Is there a particular font that your application is expecting to use?
from openjdk-docker.
@karianna SansSerif in our case
from openjdk-docker.
@brunoborges - I see three options here:
- Ask distroless base image provider to provide a minimum set of fonts
- Provide docs on how to add for end users
- Bundle fonts with OpenJDK (which I think typically don't do as we prefer to allow the O/S to do so)
Thoughts?
from openjdk-docker.
@karianna any news here?
from openjdk-docker.
@floriankoch we are editing the documentation this week.
As for what we will be adding, you can see this example on how to add a package on a build-layer in a Dockerfile, and then copy installed packages to the final distroless image.
from openjdk-docker.
@floriankoch can you please provide a sample Java code that tries to load the extra fonts? I'd like to test the instructions.
from openjdk-docker.
@brunoborges the error comes from a third party application (camunda) - i do not have the exact code
I added this to my multi stage dockerfile
RUN mkdir /dejavu \
&& tdnf install -y --releasever=2.0 --installroot /dejavu dejavu-sans-fonts
RUN mkdir /fontconfig \
&& tdnf install -y --releasever=2.0 --installroot /fontconfig fontconfig
RUN mkdir /freetype \
&& tdnf install -y --releasever=2.0 --installroot /freetype freetype
# Clean up
RUN rm -rf /dejavu/etc/dnf \
&& rm -rf /dejavu/run/* \
&& rm -rf /dejavu/var/cache/dnf
RUN rm -rf /fontconfig/etc/dnf \
&& rm -rf /fontconfig/run/* \
&& rm -rf /fontconfig/var/cache/dnf \
&& find /fontconfig/var/log -type f -size +0 -delete
RUN rm -rf /freetype/etc/dnf \
&& rm -rf /freetype/run/* \
&& rm -rf /freetype/var/cache/dnf \
&& find /freetype/var/log -type f -size +0 -delete
...
COPY --from=builder /dejavu /
COPY --from=builder /fontconfig /
COPY --from=builder /freetype /
and use this program to test if java find the fonts
import java.awt.*;
public class FontTest {
public static void main(String[] args) {
String[] names = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
System.out.println("Found " + names.length + " fonts:");
for (String name : names) {
System.out.println(name);
}
}
}
looks good so far ... now we test with the application
docker run -it -v $PWD:/tmp test:1 java -cp /tmp FontTest
Found 8 fonts:
DejaVu Sans
DejaVu Sans Condensed
DejaVu Sans Light
Dialog
DialogInput
Monospaced
SansSerif
Serif
from openjdk-docker.
Related Issues (20)
- RPM Package for 17 not updating automatically
- Provide regular updates of Docker images (was: CVE's CBL-Mariner) HOT 8
- Include test to check all images have CDS enabled
- Build more often, fix security issues HOT 6
- Remove src.zip from final images
- Staging directory in Distroless build not cleaned up correctly HOT 1
- Publish AArch64 (Arm64) container images HOT 3
- USER option not working HOT 2
- Slow startup times when using distroless base-image HOT 11
- Allow consumers to run apps as non-root users HOT 1
- Upgrade Ubuntu images to 22.04
- Add documentation about non-root user HOT 1
- Rename repository to openjdk-containers
- Java Exception: trustAnchors parameter must be non-empty HOT 12
- /usr/lib/jvm/msopenjdk-17-amd64/lib/libfontmanager.so: libfreetype.so: cannot open shared object file: No such file or directory HOT 10
- libfreetype.so is missing in /usr/lib/jvm/msopenjdk-17-arm64/lib (arm64 - not amd64) HOT 3
- Add distroless debug HOT 1
- Wrong base image for Ubuntu images HOT 3
- Locale definitions are missing in distroless images
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openjdk-docker.