As you learned, lifecycle hooks were not made to change anything inside a container image. Remember that container images are, by design, immutable. It looks you want to build a custom container image that includes your customizations to the wildfly configs plus your application. There are two ways to accomplish that with OpenShift:
1. Create a Dockerfile that uses the standard wildfly container image as the parent, and adds your customization.
2. Use the OpenShift source-to-image (s2i) process to add configurations and your application. See the OpenShift docs about the wildfly s2i builder image for details, this is easier than using a Dockerfile. The standard s2i processes builds the application from sources, but it also supports feeding an application war/ear.
3. If don't want to create a new custom image, but want to add additional actions before application started in the container, mount a shell script into the container from a config map. Override the command for the pod to run your script mounted from config map. Do you work in the script, with your script then doing an exec on the original command for the application.
s, Fernando Lozano
users mailing listusers lists openshift redhat com