How it works...

The reason why it's so simple is because you are using a platform that's designed to make it simple. So all the heavy lifting that you'd need to do it in your own infrastructure is done by the platform.

The change we've made to make the application run in the OpenShift is quite simple:

USER rootRUN chown -R glassfish:glassfish_grp ${DEPLOYMENT_DIR}/app.war \    && chmod -R 777 ${DEPLOYMENT_DIR}/app.warUSER glassfish

First, we use the root user to change the permissions of app.war. Then the main point is to specify to use the glassfish user. This feature tells Docker that the internal process will be owned by the glassfish user, and not by root.

Get Java EE 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.