How To Run iDempiere with Oracle 21c Docker in Ubuntu
This is a high level how to about how to run iDempiere with Oracle 21c using docker in ubuntu.
It is expected that you are familiar with ubuntu CLI.
Install java
sudo apt-get install openjdk-17-jdk-headless
Install docker
sudo apt-get install docker.io
Enable your user to run docker
sudo usermod -aG docker $USER newgrp docker
Download the official oracle XE 21c
docker pull container-registry.oracle.com/database/express:21.3.0-xe
Download the daily iDempiere installer from sourceforge
cd /tmp wget -O idempiereServerDev12Daily.gtk.linux.x86_64.zip https://sourceforge.net/projects/idempiere/files/devel/daily-server/idempiereServerDev12Daily.gtk.linux.x86_64.zip/download
Unzip installer in /opt/idempiere-server
unzip idempiereServerDev12Daily.gtk.linux.x86_64.zip sudo mv idempiere.gtk.linux.x86_64/idempiere-server /opt/
Run oracle XE 21c on docker
- docker requires the /opt/idempiere-server/data/seed folder to be able to import the seed database
- docker requires the /opt/idempiere-server/utils/oracle folder to be able to run the scripts
docker run -d --name xe21 \ -v /opt/idempiere-server/data/seed:/opt/idempiere-server/data/seed \ -v /opt/idempiere-server/utils/oracle:/opt/idempiere-server/utils/oracle \ -p 1521:1521 \ container-registry.oracle.com/database/express:21.3.0-xe
IMPORTANT NOTE: In this example I don't take care of persistent database because is used just for development purposes, but if you plan to use this in a more serious environment is better to take care of persistence adding the parameter -v [<host mount point>:]/opt/oracle/oradata
check STATUS of the docker being created
docker ps -a
Keep checking until the STATUS says (healthy)
Set the oracle password
NOTE: This is setting the password of SYS and SYSTEM users to "oracle", please use here a safer password, this is just an unsafe example
docker exec xe21 ./setPassword.sh oracle
Create local wrappers for oracle commands
Create the following file, this is just a wrapper to execute sqlplus command within the docker container:
echo '#!/bin/bash docker exec -u oracle -w /opt/idempiere-server -e NLS_LANG=$NLS_LANG -i xe21 /opt/oracle/product/21c/dbhomeXE/bin/$(basename $0) "$@"' | sudo tee /usr/local/bin/sqlplus sudo chmod 755 /usr/local/bin/sqlplus
And then the same script can be used for impdp and expdp
sudo ln /usr/local/bin/sqlplus /usr/local/bin/impdp sudo ln /usr/local/bin/sqlplus /usr/local/bin/expdp
Test point: try here connection to the oracle instance
sqlplus system/oracle@localhost/xe logout
Install iDempiere Server
cd /opt/idempiere-server bash console-setup-alt.sh
Common answers:
Java Home = [ENTER] -> /usr/lib/jvm/java-17-openjdk-amd64 Java Options = [ENTER] -> -Xms64M -Xmx512M iDempiere Home = [ENTER] -> /opt/idempiere-server Key Store Password = [ENTER] -> myPassword (ON) Common Name = [ENTER] -> iDempiere (OU) Organization Unit = iDempiereUser (O) Organization = iDempiere (L) Locale/Town = Krefeld (S) State = NRW (C) Country (2 Char) = DE Application Server Host Name = 0.0.0.0 Application Server Web Port = 8012 Application Server SSL Port = 8412 DB Already Exists?(Y/N) = N Database Type 1. Oracle = 1 Database Server Host Name = localhost Database Server Port = 1521 Database Name = xepdb1 Database user = adempiere Database Password = adempiere Database System User Password = oracle Mail Server Host Name = [ENTER] -> localhost Mail User Login = [ENTER] -> Mail User Password = [ENTER] -> Administrator EMail = [ENTER] -> Save changes (Y/N) = Y
Configure permissions for the server folders
First you need to obtain the GID (Group ID) of the DBA within the container:
docker exec -it xe21 bash -c "getent group dba | cut -d: -f3"
in my case this returned 54322, so we need to change the group to these folders:
sudo chgrp 54322 /opt/idempiere-server/data sudo chgrp 54322 /opt/idempiere-server/data/seed sudo chgrp 54322 /opt/idempiere-server/data/seed/Adempiere.dmp
Import the database seed
cd /opt/idempiere-server/utils bash RUN_ImportIdempiere.sh
NOTE: if your system has a group with name dba, it's possible that this command fails because the script oracle/ImportIdempiere.sh changes back the group to dba. If that's the case you can comment those lines in the script to avoid changing back the group.
Run iDempiere Server
cd /opt/idempiere-server bash idempiere-server.sh