As we (Cristina Gonzalez and Andrea Di Giorgi) were talking, we'd like to be able to hook the testable tomcat lifecycle, to not use the bundle present on source code, using a docker image configured in the same way instead.
For that, the build must perform some checks to determine if it must use the bundle or the docker image.
As an example, but not necessarily done this way, and following the same approach that the WeDeploy team uses, if the project (mainly subrepos) has a container.json file describing the image the project needs, then the docker image will be used instead of the bundle.
That descriptor must hold information about:
- Liferay docker image (i.e. mdelapenya/liferay-portal:7-ce-ga3-tomcat-hsql)
- env variables
- JAVA_OPTS="jmxOptions debugMode"
So that the build system will run a docker container from the image, with some JAVA_OPTS added to the environment variables, exposing some ports, and declaring some volumes.
An initial approach would be executing a docker command as the following example:
But in the near future, or if we consider it, we could move to another approach based on using an already existing Docker Gradle plugin.