Public Repository

Last pushed: a year ago
Short Description
Jboss Enterprise Application Server 6.4.0 GA with Liferay Enterprise Edition 6.2 SP12
Full Description

Dockerfile link

Requirement

  • Your Subscription license file for Liferay Enterprise 6.2 e.g your_license_file.xml. Without this you will not be able to proceed with the Liferay startup wizard.
  • Docker version 1.9 or higher.
  • Docker compose 1.6 or higher.

Quickstart Guide

This basic docker run command will spin up the Liferay container using Jboss' default H2 datasource.

docker run -d -p 9990:9990 -p 8080:8080 bzon/jboss-liferay:6.2-ee-sp12

Advanced Guide - Running with an External Database

As of this writing, this Docker image is configured to cater MySql 5, Oracle 11g and Oracle12c databases as external datasource.

You should define your database type in the variable JBOSS_AS_DB_DRIVER_NAME and the only choices are:

  • mysql
  • oracle-11g
  • oracle-12c

Note that these are hardcoded driver names that you can find in resources/conf/standalone.xml.template.

NOTE: Leave this blank and Liferay will use the default H2 database.

Using MySQL Database

  • Go to the compose-for-mysql directory and run docker-compose.

      cd compose-for-mysql/
      docker-compose up -d
    
  • By default the docker-compose command will use the configuration from mysql-sample.env file.

      # Sample configuration if Liferay will use a MySQL database
    
      JVM_XMX_SIZE=4096m
      JVM_XMS_SIZE=4096m
    
      # Not editable - mysql is hardcoded as the driver name in standalone.xml
      JBOSS_AS_DB_DRIVER_NAME=mysql
    
      # Not editable - This is the configured driver class for MySQL
      PORTAL_EXT_DEFAULT_DS_DRIVER_CLASS=com.mysql.jdbc.Driver
    
      # Edit with caution
      JBOSS_AS_DS_JNDI=java:jboss/LiferayMySQLPool
      PORTAL_EXT_DEFAULT_DS_JNDI=java:jboss/LiferayMySQLPool
    
      # 'liferaydb' is the service name of mysql database in the docker compose file
      # These values are also the defaults in the image. See the Dockerfile for reference.
      JBOSS_AS_JDBC_URL=jdbc:mysql://liferaydb:3306/lportal
      JBOSS_AS_DB_HOST=liferaydb
      JBOSS_AS_DB_PORT=3306
      JBOSS_AS_DB_USER=lportal
      JBOSS_AS_DB_PASSWORD=lportal
      JBOSS_AS_DB_NAME=lportal
    
      # Edit with your preference
      JBOSS_AS_DS_POOL=LiferayMySQLPool
      PORTAL_EXT_CONTEXT_ROOT=/liferay
    

Using Oracle Database

This is an example how you can use an Oracle 12c Database instance as your datasource. The following scenario assumes that your database is on a different server.

  • Configure the oracle12c-sample.env file.

      # Sample configuration if Liferay will use an Oracle database
    
      JVM_XMX_SIZE=4096m
      JVM_XMS_SIZE=4096m
    
      # Not editable - Oracle is hardcoded as the driver name in standalone.xml
      JBOSS_AS_DB_DRIVER_NAME=oracle-12c
    
      # Not editable - This is the configured driver class for Oracle 12c database
      PORTAL_EXT_DEFAULT_DS_DRIVER_CLASS=com.oracle.ojdbc7
    
      # Edit with caution the jboss datasource format should be 'java:jboss/'
      JBOSS_AS_DS_JNDI=java:jboss/LiferayOracle12cPool
      PORTAL_EXT_DEFAULT_DS_JNDI=java:jboss/LiferayOracle12cPool
    
      # Fillup with the correct database information
      # 172.31.41.107 is the remote server where the oracle database instance is running
      JBOSS_AS_JDBC_URL=jdbc:oracle:thin:@172.31.41.107:1521/ORACLEDB
      JBOSS_AS_DB_HOST=172.31.41.107
      JBOSS_AS_DB_PORT=1521
      JBOSS_AS_DB_USER=SYSTEM
      JBOSS_AS_DB_PASSWORD=ORACLEPWD
      JBOSS_AS_DB_NAME=ORACLEDB
    
      # Edit with your preference
      JBOSS_AS_DS_POOL=LiferayOracle12cPool
      PORTAL_EXT_CONTEXT_ROOT=/liferay
    
  • Run docker-compose

      cd compose-for-oracle/
      docker-compose up -d
    

If what you have is an Oracle 11g database, you can create your own environment file. See oracle11g-sample.env file then modify or create a docker-compose.yml file with the following content.

services:
  liferayapp:
    image: bzon/jboss-liferay:6.2-ee-sp12
    container_name: liferay
    ports:
      - "8080:8080"
      - "9990:9990"
    env_file:
     - oracle11g-sample.env

Your Access Information

Description Value
Liferay Application URL http://localhost:8080/liferay
Jboss Management Console http://localhost:9990/console
Jboss Administrator admin
Jboss Administrator Password admin123!

The page should display some Licensing issue and that you'll need to enter your Order ID.

Enabling License

  • Copy your license file inside the running Liferay container:

    # **docker cp** will copy the license.xml as root by default
    docker cp license.xml liferay:/tmp/
    
  • Transfer the license file to the deploy directory as jboss user:

  • docker exec -it liferay cp /tmp/license.xml /opt/jboss/deploy/
    
  • Observe the logs to see that the license file has been deployed successfully.

    docker exec -it liferay cat  /opt/jboss/logs/liferay.$(date +%Y-%m-%d).log
    16:36:45,270 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][AutoDeployDir:204] Processing license.xml
    16:36:45,276 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][LicenseAutoDeployListener:?] Copying license for /opt/jboss/deploy/license.xml
    16:36:45,308 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][LicenseManager:?] Portal Development license validation passed
    16:36:45,308 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][LicenseDeployer:?] License registered
    

If successful, access the page again and you should now be able to proceed with the Liferay Wizard.

Docker Pull Command
Owner
bzon