RE: New Multi-variant Docker Images for Liferay Portal CE

thumbnail
Jamie Sammons, modified 4 Years ago. New Member Posts: 3 Join Date: 7/7/19 Recent Posts

Hello Liferay Community,


I want to present new multi-variant Docker images that I developed for the Liferay Portal Community Edition. These images are based on OpenJDK and Tomcat. The following JDK-OS variants are available:

  • JDK 11, based on Debian Buster
  • JDK 8, based on Debian Buster
  • JDK 8, based on Alpine Linux

The implementation of Dockerfile templates for the variants mentioned above is similar to Dockerfile templates that can be found in the Docker Hub's official images

Some of the implementation details to highlight:

  • Use a multi-stage build to reduce the image size.
  • Step down from root to a non-privileged user during container startup.
  • Override CMD's default values. 
  • Externalize the LIFERAY_HOME/deploy and LIFERAY_HOME/data/document_library directories.
  • Add new files or override existing ones.
  • Allow execution of custom shell scripts.

7.3.6-ga7 is the latest version released:  

NOTE: Bundled with Liferay Commerce.

For more details, please see the repository on Docker Hub.

Thank you,

Igor Baiborodine

 

thumbnail
William Gosse, modified 6 Years ago. Liferay Master Posts: 533 Join Date: 7/4/10 Recent Posts
What about the database. Would that need to be externalized as well or are you assuming the use of Hypersonic? 
thumbnail
Igor Baiborodine, modified 6 Years ago. New Member Posts: 3 Join Date: 7/7/19 Recent Posts
The database can be externalized via the portal-ext.properties file. To do so, you will need:
  • Create a directory on a suitable volume on your host system, e.g. /my/own/liferaybasedir.
  • In the portal-ext.properties file, define the connection properties for your external DB.
  • Place the portal-ext.properties file into the /my/own/liferaybasedir directory.
  • Start your liferay-portal instance like this:
$ docker run --name <container name> -v /my/own/liferaybasedir:/etc/opt/liferay -d ibaiborodine/liferay-portal-ce:<tag>

Then the portal-ext.properties file will be copied to container's LIFERAY_HOME directory when the container starts.
thumbnail
Igor Baiborodine, modified 6 Years ago. New Member Posts: 3 Join Date: 7/7/19 Recent Posts
William,

Also, here is an example of docker-compose.yml with an externalized data source  (MySQL). You can test it in your local dev by executing the following commands:

$ git clone https://github.com/igor-baiborodine/docker-liferay-portal-ce.git
$ cd docker-liferay-portal-ce/compose/liferay-mysql   
$ docker-compose up -d
thumbnail
William Gosse, modified 6 Years ago. Liferay Master Posts: 533 Join Date: 7/4/10 Recent Posts
Thanks for your quick response. Its very helpful.
thumbnail
Yaseen Meridjal, modified 4 Years ago. New Member Post: 1 Join Date: 3/28/17 Recent Posts

Slghtly unrelated perhaps but I was wondering if there's a Docker image of Liferat 7.3.x without the Commerce module?