Container Lifecycle and API¶
At a high level, the container starts Tomcat with Liferay deployed on it. Additionally, however, the container entry point provides an API for executing these use cases:
Invoking scripts
Configuring Tomcat and Liferay
Deploying artifacts
Installing patches
Updating the Patching Tool
The container provides an API for triggering and configuring these use cases. It executes the use cases in different phases of its lifecycle.
Lifecycle¶
After you create a container in an environment, the container entry point executes the following lifecycle phases in that environment:
Pre-configure: Runs user-provided scripts before configuring Tomcat and Liferay.
Configure: Prepares for running Liferay on Tomcat.
Update the Patching Tool with the user-provided version.
Pre-startup: Runs user-provided scripts before starting Tomcat.
Tomcat startup: Launches Tomcat using the Catalina script.
Post-shutdown: Runs user-provided scripts after Tomcat stops.
API¶
The container entry point scans the following container folders for files and uses those files to configure the container, Tomcat, and Liferay and to act on Liferay.
/mnt/liferay
/user/local/liferay/scripts
Note
You can pass files to these container folders in several different ways, including using bind mounts, volumes, and docker cp
. See Providing Files to the Container for more information.
The key folders above have subfolders that are designated for specific actions. The subfolders, the actions taken on their files, and associated use cases are listed in lifecycle phase order in the following sections.
The following lifecycle phases act on user-provided files.
Pre-Configure Phase API¶
File Location |
Action |
Use Cases |
---|---|---|
|
Run scripts in alphabetical order |
Running scripts before the Configure Phase |
Configure Phase API¶
File Location |
Action |
Use Cases |
---|---|---|
|
Copy files to corresponding folders under Liferay Home ( |
|
|
Run scripts in alphabetical order |
Running scripts during configuration |
|
Symbolically link |
|
|
If a Patching Tool is provided, install it. Install any patches provided. |
Pre-Startup Phase API¶
File Location |
Action |
Use Cases |
---|---|---|
|
Run scripts in alphabetical order |
Running scripts before starting Tomcat |
Post-Shutdown Phase API¶
File Location |
Action |
Use Cases |
---|---|---|
|
Run scripts in alphabetical order |
Running scripts after shutting down Tomcat |
What’s Next¶
Now that you’re familiar with the container lifecycle and API, you can determine the best ways to provide files to the container. You can alternatively start exercising the use cases mentioned in the tables above. They’re listed here for your convenience: