
Modernizing Oracle Tuxedo Applications with Python
By :

Oracle provides Dockerfiles and commands to build Docker images for Oracle products on GitHub (https://github.com/oracle/docker-images). Tuxedo is no exception, although Oracle considers it old content and has moved into an archive location where it is available today. Therefore, we will create more up-to-date Docker images ourselves.
To install Tuxedo, you must first download it from the Oracle website (http://www.oracle.com/technetwork/middleware/tuxedo/downloads/index.html). You will have to create an account if you don't already have one. Tuxedo is available for different operating systems: AIX, Linux, HP-UX, Solaris, and Microsoft Windows. For all examples in this book, we will use the latest release of Oracle Tuxedo 12cR2 (12.2.2) and an installation package that includes all the required add-ons called "Oracle Tuxedo 12cR2 (12.2.2)" (including Tuxedo, SALT, and Jolt) for Linux x86-64 (64-bit). The downloaded file will be named tuxedo122200_64_Linux_01_x86.zip
.
Create a new folder and put the downloaded tuxedo122200_64_Linux_01_x86.zip
file there. You will need to create tuxedo1222.rsp
and Dockerfile
files in the same folder as the downloaded file.
We start with tuxedo1222.rsp
, which contains answers for Oracle Tuxedo installer so that it can be installed in silent mode:
RESPONSEFILE_VERSION=2.2.1.0.0 FROM_LOCATION="/home/oracle/Disk1/stage/products.xml" ORACLE_HOME="/home/oracle/tuxhome" ORACLE_HOME_NAME="tuxhome" INSTALL_TYPE="Custom Install" DEPENDENCY_LIST={"tuxedoServer:12.2.2.0.0","atmiClient:12.2.2.0.0"} TLISTEN_PASSWORD="oracle"
This is a minimized response file that contains only the required responses. Here are the most important things:
FROM_LOCATION
gives the location of the unpacked ZIP file.ORACLE_HOME
and ORACLE_HOME_NAME
say that Tuxedo will be installed under /home/oracle/tuxhome
.INSTALL_TYPE
says we will install only selected components.TOPLEVEL_COMPONENT
and DEPENDENCY_LIST
say that only the core Tuxedo should be installed.Then we need a Dockerfile
file that contains instructions for building a Docker image:
FROM oraclelinux:8 RUN yum -y install oracle-release-el8 && \ yum -y install \ libnsl java-devel gcc-c++ python3-devel \ unzip file hostname which sudo && \ rm -rf /var/cache/yum RUN groupadd oracle && \ useradd -m -g oracle -s /bin/bash oracle && \ echo 'oracle ALL=(ALL) NOPASSWD:ALL' \ >> /etc/sudoers.d/oracle USER oracle COPY tuxedo1222.rsp tuxedo122200_64_Linux_01_x86.zip /home/oracle/ ENV ORACLE_HOME=/home/oracle/tuxhome \ JAVA_HOME=/etc/alternatives/java_sdk RUN cd ~/ && \ jar xf tuxedo122200_64_Linux_01_x86.zip && \ cd ~/Disk1/install && \ chmod -R +x * && \ ./runInstaller.sh -responseFile ~/tuxedo1222.rsp \ -silent -waitforcompletion && \ rm -rf ~/Disk1 && \ rm -f ~/tuxedo1222.rsp ~/tuxedo122200_64_Linux_01_x86.zip ENV TUXDIR=/home/oracle/tuxhome/tuxedo12.2.2.0.0 ENV PATH=$PATH:$TUXDIR/bin ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TUXDIR/lib USER root RUN pip3 install tuxedo USER oracle WORKDIR /home/oracle
Once you have it, you can run the following command:
docker build -t tuxpy .
This command creates the Docker image. While it runs for several minutes, let's take a look at the most important steps:
yum
package manager to install Python version 3, Java for running the Oracle Tuxedo installer, and the GCC compiler for building a Python module.oracle
and give permissions to run sudo
for installing other software packages.TUXDIR
environment variable that points to the directory where Tuxedo is installed and set up program and library paths to include Tuxedo binaries.tuxedo
module is installed using the pip3
tool.After that, you can start the newly created image by using the following command:
docker run -ti --privileged tuxpy bash
If you are using Docker Desktop on Microsoft Windows, you may need to add winpty
in front of the command:
winpty docker run -ti --privileged tuxpy bash
The --privileged
parameter gives extended privileges to the container that will be needed in Chapter 3, Tuxedo in Detail to resize message queues.
If you have any preferences for a text editor or other tools, you can install them by using sudo yum install
and the package name. As an exercise, take a look at the Python examples that use SCA under $TUXDIR/samples/sca/simp_python
. It will make you appreciate the simplicity of your first Tuxedo application in Python, which we will create in the next chapter.