Empty /opt/eap (/opt/server) directory in EAP 8 runtime image

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform
    • 8.0.0

Issue

The build process does not copied the EAP files into the JBOSS_HOME location and thus running either image simply produces the following error;
ERROR *** No installed Server, exiting ***

CONTAINER ID  IMAGE                                                                                      COMMAND    CREATED         STATUS             PORTS                   NAMES
3bab35a8f473  registry.redhat.io/jboss-eap-8-tech-preview/eap8-openjdk17-runtime-openshift-rhel8:latest  /bin/bash  12 seconds ago  Up 12 seconds ago  0.0.0.0:8080->8080/tcp  runtime_test_eap8_v1
...
[jboss@3bab35a8f473 opt]$ ls -la
total 0
drwxrwxr-x. 1 jboss root  46 Feb  7 17:58 .
drwxr-xr-x. 1 root  root  17 Mar 20 05:08 ..
lrwxrwxrwx. 1 jboss root  11 Feb  7 17:58 eap -> /opt/server
drwxrwxr-x. 3 jboss root  23 Feb  7 17:56 jboss
drwxr-xr-x. 2 jboss root 131 Feb  7 17:58 run-java


[jboss@3bab35a8f473 run]$ pwd
/opt/jboss/container/wildfly/run

[jboss@3bab35a8f473 run]$ ./run
ERROR *** No installed Server, exiting ***

  • EAP8 Builder
sudo podman run -ti -d --name builder_EAP8 -p 8080:8080 registry.redhat.io/jboss-eap-8-tech-preview/eap8-openjdk17-runtime-openshift-rhel8:latest


$ sudo podman run -ti -d --name builder_EAP8 -p 8080:8080 registry.redhat.io/jboss-eap-8-tech-preview/eap8-openjdk17-runtime-openshift-rhel8:latest /bin/bash
b264d5149c04e6a49e6fefc5d00f32171d11501d5326a53ae04cfa2623631a51
[quicklab@node-0 ~]$ sudo podman ps
CONTAINER ID  IMAGE                                                                                      COMMAND    CREATED        STATUS            PORTS                   NAMES
b264d5149c04  registry.redhat.io/jboss-eap-8-tech-preview/eap8-openjdk17-runtime-openshift-rhel8:latest  /bin/bash  9 seconds ago  Up 9 seconds ago  0.0.0.0:8080->8080/tcp  builder_EAP8

[quicklab@node-0 ~]$ sudo podman exec -it builder_EAP8 /bin/bash
[jboss@b264d5149c04 ~]$ ls
[jboss@b264d5149c04 ~]$ pwd
/home/jboss
[jboss@b264d5149c04 ~]$ ls
[jboss@b264d5149c04 ~]$ cd /opt/
[jboss@b264d5149c04 opt]$ ls -la
total 0
drwxrwxr-x. 1 jboss root  46 Feb  7 17:58 .
drwxr-xr-x. 1 root  root  17 Mar 20 05:47 ..
lrwxrwxrwx. 1 jboss root  11 Feb  7 17:58 eap -> /opt/server
drwxrwxr-x. 3 jboss root  23 Feb  7 17:56 jboss
drwxr-xr-x. 2 jboss root 131 Feb  7 17:58 run-java
[jboss@b264d5149c04 opt]$ cd run-java/
[jboss@b264d5149c04 run-java]$ ls
debug-options  java-default-options  parse-proxy-url.sh  proxy-options	translate-no-proxy.sh
[jboss@b264d5149c04 run-java]$ cd ../
[jboss@b264d5149c04 opt]$ cd eap
bash: cd: eap: No such file or directory

Resolution

Doing an S2I build process, the server is copied in EAP 8.

The runtime image is thin because it does not contain the EAP server, so it is smaller than the build image.
Whereas the builder image contains the full EAP server.
This is explained on JBoss EAP 7 thin image.

Using the builder image, see the following Dockerfile as an example to create an application image with EAP 8 layered image (layered image that contains OS, JDK, and EAP layers):

# Use EAP 8 Builder image to create a JBoss EAP 8 server with its default configuration
FROM registry.redhat.io/jboss-eap-8-tech-preview/eap8-openjdk17-builder-openshift-rhel8:latest AS builder
# With these 3 environments variables, a JBoss EAP 8 server is provisioned with the "same"
# cloud configuration that EAP 7.4 standalone-openshift.xml
ENV GALLEON_PROVISION_FEATURE_PACKS org.jboss.eap:wildfly-ee-galleon-pack,org.jboss.eap.cloud:eap-cloud-galleon-pack
ENV GALLEON_PROVISION_LAYERS cloud-default-config
ENV GALLEON_PROVISION_CHANNELS org.jboss.eap.channels:eap-8.0
RUN /usr/local/s2i/assemble

# Copy the JBoss EAP 8 server from the previous step into the runtime image
# then the workflow is similar than with EAP 7.4
FROM registry.redhat.io/jboss-eap-8-tech-preview/eap8-openjdk17-runtime-openshift-rhel8:latest AS runtime
COPY --from=builder --chown=jboss:root $JBOSS_HOME $JBOSS_HOME

##############################################################################################
#
# Steps to add:                                                                                    
# (1) COPY or ADD the WAR/EAR to $JBOSS_HOME/standalone/deployments                                
# (2) Modify the $JBOSS_HOME/standalone/configuration/standalone.xml (not standalone-openshift.xml)
##############################################################################################

### ENV CONFIG_IS_FINAL=true <--------------- might be needed to avoid startup load scripts changing the config

RUN chmod -R ug+rwX $JBOSS_HOME

As explained in the resolution Using Maven parameters on Buildconfig in OCP 4, the user can also use env variables such as the MAVEN_MIRROR_URL environment variable in the Docker file to use your own Maven Mirror:

...
ENV GALLEON_PROVISION_CHANNELS org.jboss.eap.channels:eap-8.0
ENV MAVEN_MIRROR_URL http://10.0.0.1:8080/repository/internal/   
RUN /usr/local/s2i/assemble
...

In the Dockerfile one can add also Galleon environment variables, such as EAP 7/8 CONFIG_IS_FINAL on Galleon Build for image building, which can be used if no configuration on the standalone is required:

...
COPY --chown=jboss:root example.war $JBOSS_HOME/standalone/deployments 
ENV CONFIG_IS_FINAL=true <----

The Dockerfile is used by the Source-To-Image process to create the EAP 8 server and will abide by the This content is not included.Maven settings.

Root Cause

The building process can only be done with the builder image, however, the following difference is notable:

CONFIG_IS_FINAL

For details on CONFIG_IS_FINAL see the solution EAP 7/8 CONFIG_IS_FINAL on Galleon Build for image building.

EAP 7 vs EAP 8:

DirectorySize
EAP 7EAP 7 runtime images do not contain an EAP server. The EAP 7 builder images contain a full server.
EAP 8Do not container the server. During the S2I build process, the server is copied.

The difference with EAP 8 aims to save space, by reducing the image sizes, however - and even more importantly - EAP 8 aims to not release new images for each new update/patch. So the build process brings the latest version on the channel, not via image tag.

IssueSolution
Why the builder image is larger than thin imageJBoss EAP 7 thin image
Customize the template buildingCustomizing EAP 7 Template buildconfig deployment in OCP 4
Deploy applications with EAP 7 OperatorHow to deploy an application in JBoss EAP 7 in OCP 4
Custom module in EAP 7Creating a custom module in EAP 7's OCP image
Custom configuration in EAP 7What are the options to use a custom runtime EAP configurations
EAP 7 trimming using GalleonAfter installing EAP openshift trimmed with Galleon cannot find openshift-launch.sh
EAP 7 Operator service creationJBoss EAP 7 Operator creates LoadBalancer service
Template (S2I options)JBoss EAP S2I build template options
Usage of provisioning.xmlJBoss EAP 7 Galleon using provisioning.xml
Troubleshooting EAP 7 BuildConfig in OCP 4Troubleshooting EAP 7 local BuildConfig in OCP 4
PING protocol is missing on configuration although jgroups is presentEAP 7/8 CONFIG_IS_FINAL on Galleon Build for image building
Components
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.