This document describes how to build an RPC Server for Java Docker image and run the Docker container using scripts provided with EntireX. It covers the following topics:
Operating system Linux
Docker installation 1.13.1 or compatible
Software AG EntireX installation containing the package EntireX > Core Files
The scripts provided with EntireX support the following three methods of building a Docker image and running the Docker container.
To copy license, configuration and customer service implementation files into Docker container
Set your working directory to <install_dir>/EntireX/docker/JavaRpcServer.
Create the TAR file containing all the necessary files with the following command:
./CreateEntireXJavaRpcServerTar.sh
Provide your configuration files into the current working directory, for example:
myLicense
myConfiguration
myData/myClassFiles
Note:
All files are required if you are using this method.
Update the Dockerfile, for example:
# Possibility to add a valid license file already to the image instead of # providing it during start up # e.g.: ADD myLicense /licenses/license.xml # Possibility to add a different configuration file already to the image instead of # providing it during start up # e.g.: ADD myConfiguration /configs/entirex.javarpcserver.properties # Possibility to add server implementation to the image # e.g.: ADD myData/. /data
Build the server image:
docker build -t exx_java_rpc_server_image_1 .
In this case the Docker build
command copies the configuration into the image.
Start the container:
docker run -d -e ACCEPT_EULA=Y --name exx_java_rpc_server_container_1 exx_java_rpc_server_image_1
Advantages
The complete configuration is in the image. For troubleshooting, Software AG Support will require only the image and the command
you entered.
Disadvantage
If the configuration changes, you will have to build a new image before you rerun the container.
To copy license, configuration and customer service implementation files into container, using default file names
(Customer service implementation classes are provided in directory mounted to /data.)
Set your working directory to <install_dir>/EntireX/docker/JavaRpcServer.
Create the TAR file containing all the necessary files with the following command:
./CreateEntireXJavaRpcServerTar.sh
Build the server image:
docker build -t exx_java_rpc_server_image_2 .
Provide your license, configuration and server implementation files with the default file names, for example:
<my-license-dir>/license.xml
<my-config-dir>/entirex.javarpcserver.properties
<my-data-dir>/<custom classes>
Note:
All files are required if you are using this method.
In this case the license and configuration files are mounted during startup.
Start the container:
docker run -d -e ACCEPT_EULA=Y -v <my-license-dir>:/licenses -v <my-config-dir>:/configs -v <my-data-dir>:/data --name exx_java_rpc_server_container_2 exx_java_rpc_server_image_2
Advantages
If the configuration changes, you do not need to rebuild the image; you only need to rerun the container.
Disadvantage
The configuration, license and data files are mounted to the container. For troubleshooting, Software AG Support will require
the image, configuration, license, data files and the command you entered.
To copy license, configuration and customer service implementation files into container, using custom file names
(Customer service implementation JAR file are provided in directory mounted to /data.)
Set your working directory to <install_dir>/EntireX/docker/JavaRpcServer.
Create the TAR file containing all the necessary files with the following command:
./CreateEntireXJavaRpcServerTar.sh
Build the server image:
docker build -t exx_java_rpc_server_image_3 .
Provide your configuration files with your own file names, for example:
<my-license-dir>/myLicense
<my-config-dir>/my.entirex.javarpcserver.properties
<my-data-dir>/<custom jar file>
Note:
All files are required if you are using this method.
In this case the license and configuration files are mounted during startup.
Start the container:
docker run -d -e ACCEPT_EULA=Y -e "EXX_LICENSE_KEY=myLicense.xml" -e "EXX_JAVA_SERVER_CONFIGURATION=my.entirex.javarpcserver.properties" -e "EXX_JAVA_SERVER_CLASSPATH=/data/custom.jar" -v <my-license-dir>:/licenses -v <my-configuration-dir>:/configs -v <my-data-dir>:/data --name exx_java_rpc_server_container_3 exx_java_rpc_server_image_3
Advantages
If the configuration changes, you do not need to rebuild the image; you only need to rerun the container. You can choose your
own file names.
Disadvantage
The configuration, license and data files are mounted to the container.
For troubleshooting, Software AG Support will require the image, configuration, license, data files and the command you entered.
To verify the build
Show the image with command
docker images
Start the docker image to be verified as described above, for example:
docker run -d -e ACCEPT_EULA=Y --name exx_java_rpc_server_container_1 exx_java_rpc_server_image_1
Show the log:
docker logs -f exx_java_rpc_server_container_1
Show the containers:
docker ps
Stop the container:
docker stop exx_java_rpc_server_container_1
Delete the container:
docker rm exx_java_rpc_server_container_1
Remove the image:
docker rmi exx_java_rpc_server_image_1
The docker directory for RPC Server for Java contains a script healthcheck.sh
.
Execution of this script pings the RPC server and returns the result of the ping command:
0 | success |
---|---|
1 | ping failure |
In the Docker context, this healthcheck.sh
is put into the Docker container and enabled by setting the HEALTHCHECK
instruction in the Dockerfile.
You can also use the healthcheck.sh
script in the context of an orchestration tool (e.g. Kubernetes) to enable healthcheck functionality.