paketo-buildpacks / bellsoft-liberica

A Cloud Native Buildpack that provides the Bellsoft Liberica implementations of JREs and JDKs
Apache License 2.0
68 stars 20 forks source link

`Disables JVM DNS caching if link-local DNS is available` does not work #674

Open Drimkast opened 1 month ago

Drimkast commented 1 month ago

When link-local DNS cache is present i have warning at start of docker container: WARNING: Unable to disable JVM DNS caching disabled in favor of link-local DNS caching because /layers/paketo-buildpacks_bellsoft-liberica/java-security-properties/java-security.properties is read-only

It seems problem in contribute java-security-properties layer at build time here and trying to access it at runtime here

Steps to Reproduce

  1. Run any docker image built with bellsoft-liberica buildpack and enabled link-local DNS cache. Reproduces on local docker env with mounted /etc/resolv.conf containing nameserver 169.254.25.10
dmikusa commented 1 month ago

Can you attach a full build log? It would be helpful to get more context on what is happening, what buildpacks are being used, etc...

Thanks

Drimkast commented 1 month ago

build.log

dmikusa commented 1 month ago

Is this something new you're seeing? Like after a recent buildpack upgrade? Or are you trying some new options/configuration? What command are you using to run your app?

Drimkast commented 1 month ago

This behavior appeared after adding DNS cahce in k8s (/etc/resolv.conf like real k8s)

Drimkast commented 1 month ago

I use Spring Boot Gradle plugin and build app via bootBuildImage task

dmikusa commented 1 month ago

OK, I think I know what's going on here. This is related to changes in the Jammy stack, where files are not writable by default. We are going to need to either a.) make this file group writable so it can be modified at build time or copy it to /tmp, modify, and change the JVM to read from there.