Legacy Knowledge Base
Published Jun. 30, 2025

Building a Docker image with Liferay based on another OS (Red Hat)

Written By

Sorin Pop

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

NOTE: The following resolution requires customization and should only be implemented at the discretion of your team. Liferay Support will not be able to assist with designing or implementing customizations.

Issue

  • I have a problem with the fact that Liferay's official DXP Docker images are based on Ubuntu, so I want to make an image for myself, with Red Hat
  • So I am currently building a custom Docker image on a Red Hat Linux operating system, following these steps:

    1. Downloaded Liferay DXP 7.4 - u77 bundle with Tomcat.
    2. Extracted it into the 'liferay' folder.
    3. Created the attached Dockerfile.
    4. Run "docker build -t my-liferay-image ."
    5. Started the container with "docker run -d -p 8080:8080 --name my-liferay-container my-liferay-image."
    After following these steps, when attempting to start the container, I encountered the following exception:

    2024-07-19 10:12:11 Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
    2024-07-19 10:12:11     at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:52)
    2024-07-19 10:12:11 Caused by: java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory
    2024-07-19 10:12:11     at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
    2024-07-19 10:12:11     at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    2024-07-19 10:12:11     at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:527)
    2024-07-19 10:12:11     ... 1 more

Environment

  • 7.4

Resolution

  • Disclaimer: please note that when running DXp under Docker, only our official Docker images are supported.
  • If you will use such an image to run you DXP and later on there will be some problems (that ultimately might have something to do with this choice) we will not be able to assist and we will only be able to verify, to test on an official DXP image, as the documentation states:
     

    All reported image and product issues will be diagnosed using the official Liferay Docker image at the reported tag or fix pack level.

  • Having said that, please find attached a modified dockerfile that might work (without any guarantees).
    Steps:
    Create an empty folder e.g. test
    Inside it create a new folder liferay
    Unzip the content of the downloaded official liferay bundle into liferay folder
    Open the terminal from the test folder
    Run docker build . -t myimage
    Run docker run -d -p 8080:8080 --name my-test myimage
Did this article resolve your issue ?

Legacy Knowledge Base