quarkusio / quarkus-images

Set of container images delivered for Quarkus
Apache License 2.0
115 stars 76 forks source link

Provide Package tzdata for ubi-quarkus-native-binary-s2i #264

Closed jorgecastro05 closed 5 months ago

jorgecastro05 commented 7 months ago

The package tzdata allows to set the environment variable TZ, so it can be used to change the running container timezone. I would be nice include this package in the image ubi-quarkus-native-binary-s2i in case container needs another timezone on run instead standard UTC.

cescoffier commented 7 months ago

Why would TZ be important for an s2i?

andros0689 commented 5 months ago

Hello @cescoffier, thanks for the response.

We are actually in a large mature project. We are "recently" migrating applications from SpringBoot to Quarkus 3 (based on Camel) on Openshift. We use the TZ environment variable to manage some of those applications with a specific time zone due to business requirements. Most of those paths use Java libraries like java.util.Date, so if we implement a new Date() in a Quarkus Native application, the result will be a UTC date, not the time zone we used as a focus.

This is the purpose of the ticket because of the TZ environment variable that is commonly implemented and used by the JDK 17 image for JVM builds.

Thanks.

cescoffier commented 5 months ago

So, it's not in the s2i but in the resulting image your need TZ. Am I correct?

andros0689 commented 5 months ago

So, it's not in the s2i but in the resulting image your need TZ. Am I correct?

Yes sir. The TZ utiity (guess the "tzdata" package) could be an option to define the OS Timezone when is required, not just for the Camel Context, but all context just as java images... What do you think about it? It would be too heavy for a native image?

cescoffier commented 5 months ago

It's going to increase the final image size, which is not great. So, we have to see if we can provide an option to do that.

cescoffier commented 5 months ago

Which s2i is it for? I'm not too worried about the size of the native one, as it's huge already. I'm more concerned about the binary one.

cescoffier commented 5 months ago

For the native one, it will just be another package in https://github.com/quarkusio/quarkus-images/blob/main/quarkus-native-s2i/src/main/java/io/quarkus/images/QuarkusNativeS2IBuilder.java#L18 (BTW, if you have the package name it would be super useful)

jorgecastro05 commented 5 months ago

thank you for your help, I have noticed that the package size is about 2Mi, so I made this pull request to include this package #268

cescoffier commented 5 months ago

Fixed by #268