Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to official Tomcat 9 - jre 11 base image #45

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

ahennr
Copy link
Contributor

@ahennr ahennr commented Feb 7, 2024

In this PR a change of the base image to the official Tomcat 9 (tomcat:9.0.85-jre11-temurin-jammy) image is suggested (internally based on ubuntu 22.04). In particular, I see the following advantages of this change:

  • By using this image, Java and Tomcat do not have to be installed manually and they are pre-configured in a consistent way
  • Since the Tomcat image is regularly updated on the operating system level as well as on the Tomcat side, this can be used to continuously update the built images and release them with the same tag but different digest when updating the base image, if the GeoServer version remains the same.
  • The resulting GeoServer image is about 38% smaller than the one currently provided

@buehner
Copy link
Member

buehner commented Feb 7, 2024

Thank you. I like this change and will take some time soon to test this extensively to ensure that all available features are still working with such a "basic" change.

Dockerfile Outdated
@@ -1,21 +1,48 @@
FROM ubuntu:22.04 as tomcat
FROM tomcat:9.0.85-jre11-temurin-jammy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could think about introducing build args like

ARG TOMCAT_VERSION=9.0.85
ARG JAVA_VERSION=11

FROM tomcat:${TOMCAT_VERSION}-jre{JAVA_VERSION}-temurin-jammy

This would give the build more flexibility.

We were previously using the jdk instead of jre. I don't know if there was a reason for this? Maybe @jodygarnett knows?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not know, GeoServer is supposed to only require JRE.

Copy link
Member

@aaime aaime Feb 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. But it might be tricky to get the JRE going, as it often requires less dependencies, which end up tripping either the startup, the map rendering, or specifically, the point rendering (fontconfig/harfbuzz not being installed or not completely working). Try it out with "topp:states", if that works, it should be fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea behind using the JRE image was that this would result in a smaller GeoServer image. I didn't realize that this could lead to side-effects in rendering for example. Thanks @aaime for this hint!

In 2de74a9 I switched back to JDK in order to be consistent with the previous version and to avoid the difficulties of using the JRE (see above comment). Furthermore, due to the changes in #39, the catalina.jar has to be packed/unpacked using jar to exchange the version info which is not available in the JRE image.

@buehner
Copy link
Member

buehner commented Feb 9, 2024

Would be great if you could resolve the conflicts @ahennr 🙏

@ahennr
Copy link
Contributor Author

ahennr commented Feb 9, 2024

Would be great if you could resolve the conflicts @ahennr 🙏

🏁

Dockerfile Show resolved Hide resolved
@buehner buehner mentioned this pull request Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants