2

The OpenLiberty Docker Images tagged as full contain a server.xml that only enables the javaee-8.0 feature. Those tagged as microProfile3 only enable microProfile-3.0.

I want both... even better: I'd like to have just all features enabled while I'm developing; I'll optimize for performance when I need it, i.e. maybe not at all.

Is there an easier way than to build another image with both features enabled?

rü-
  • 2,129
  • 17
  • 37

2 Answers2

2

It isn't possible to enable all features at once in Liberty because many of the features intentionally conflict with one another. For example, you can't load two different versions of the same feature at the same time (e.g. servlet-3.1 and servlet-4.0)

You can pretty concisely enable all of the latest JavaEE and MicroProfile features at once by doing this:

<server>
  <featureManager>
    <feature>javaee-8.0</feature>
    <feature>microProfile-3.2</feature>
  </featureManager>
</server>

Doing this will give quite a lot of capabilities (more than a single app typically needs). The features not included in these two umbrella features are pretty specialized, such as JCache session persistence (sessionCache-1.0) or event logging (eventLogging-1.0).

Andy Guibert
  • 41,446
  • 8
  • 38
  • 61
2

You can think of the tags as indicators for what features are included in the image more so than what's enabled by default. In other words, 'full' has all the features available and can be enabled without the need for install, whereas 'microProfile3' only has the microProfile-3 features installed. Note that some packages, like javaee8, have more than just the single feature included as it also provides other features that users may need to use alongside that single feature (though only that one feature is enabled by default). You can see the breakdown of features to package here

Andy's answer explains why you can't enable all the features at once (conflicts). Regarding whether there's an easy way to build with both features enabled, I'd recommend starting with 'full' and updating the Dockerfile to COPY the server.xml with both features (plus any other ones you'd like) to /config. Like you alluded to in your question, this is fine for development, but you would not want to do it for production as it would included a lot of extra features that you're not using. For production, you'd want to use the opposite approach and start with the smallest image (perhaps kernel) and add only the features that your application/server needs, ensuring a fit-for-purpose runtime.

M. Broz
  • 704
  • 4
  • 11