You are on page 1of 54

 

RAD Server Docker 


Technical Guide  
 

Overview 
What is RAD Server? 
What is Docker? 
Portainer 
Kubernetes 
Docker Swarm 
What is Docker Hub? 
What is Platform Assistant (PAServer)? 
What is Apache? 
What is broadwayd? 

Docker Containers 
How To Install Docker 
paserver Docker 
Build Parameters: 
Example Build: 
Run Parameters: 
Example Run: 
Control Scripts: 
Usage Scenarios: 
pa-radserver Docker 
Setup A Remote RAD Server database (InterBase) 
Build Parameters: 
Example Build: 
Run Parameters: 
Example Run: 
Control Scripts: 
RADServerDockerDeploy Project: 
Usage Scenarios: 

 
2  

pa-radserver-ib Docker 
How To License The RAD Server Docker Container 
Add License Via Slip File At Build Time 
Add License Via Serial Number And Registration At First Run 
Build Parameters: 
Example Build: 
Run Parameters: 
Example Run: 
Control Scripts: 
RADServerDockerDeploy Project: 
Usage Scenarios: 

Usage Scenarios 
paserver Scenarios: 
I.A Deploy a RAD Studio Linux console application from the RAD Studio IDE and view 
PAServer’s output via the paserver Docker container instance foreground mode. 
I.B Deploy a RAD Studio Linux GUI application from the RAD Studio IDE and view the 
application via HTML5 in a web browser on port 8082. 
I.C Build a child Docker container via a custom Dockerfile using the paserver image as a 
parent. 
pa-radserver Scenarios: 
II.A Deploy a RAD Studio Linux console application from the RAD Studio IDE and view 
PAServer’s output via the paserver Docker container instance foreground mode. 
II.B Deploy a RAD Studio Linux GUI application from the RAD Studio IDE and view the 
application via HTML5 in a web browser on port 8082. 
II.C Deploy a RAD Server resource module from the RAD Studio IDE via PAServer, 
automatically install it into emsserver.ini, and restart the Apache web server. Changes 
can be persistent if a persistent volume is used. 
II.D Re-configure a running RAD Server Docker container instance through config.sh. 
Changes can be persistent if a persistent volume is used. 
II.E Host multiple RAD Server Docker container instances that all remotely connect to a 
single RAD Server database (InterBase). 
II.F Build a child Docker container via a custom Dockerfile using the pa-radserver image 
as a parent. 
II.G Build a child Docker container via a custom Dockerfile using the pa-radserver image 
as a parent that contains a custom RAD Server resource module. Note: the custom 
module must be located in the same directory as the dockerfile. 
pa-radserver-ib Scenarios 
III.A Deploy a RAD Studio Linux console application from the RAD Studio IDE and view 
PAServer’s output via the paserver Docker container instance foreground mode. 

 
3  

III.B Deploy a RAD Studio Linux GUI application from the RAD Studio IDE and view the 
application via HTML5 in a web browser on port 8082. 
III.C Deploy a RAD Server resource module from the RAD Studio IDE via PAServer, 
automatically install it into emsserver.ini, and restart the Apache web server. Changes 
can be persistent if a persistent volume is used. 
III.D Re-configure a running RAD Server Docker container instance through config.sh. 
Changes can be persistent if a persistent volume is used. 
III.E Deploy a RAD Server production instance without PAServer and broadwayd. 
III.F Deploy a RAD Server database (InterBase) production instance without PAServer, 
broadwayd, and Apache. 
III.G Host multiple RAD Server Docker container instances that each have their own RAD 
Server database (InterBase). Note: Each pa-radserver-ib Docker uses a license. You can 
only run as many pa-radserver-ib Docker container image instances as your license 
allows. 
111.H Build a child Docker container via a custom Dockerfile using the pa-radserver-ib 
image as a parent. 
III.I Build a child Docker container that includes a custom module via a custom 
Dockerfile using the pa-radserver-ib image as a parent. 

I. PAServer Dockerfile 
Dockerfile 
Runtime Script (radserver_docker.sh) 
Sample Build And Run Commands 

II. RADServer + PAServer Dockerfile 


Dockerfile 
Runtime Script (radserver_docker.sh) 
Sample Build And Run Commands 
pa-radserver Example Child Image 
Dockerfile 
Build Command Lines 
pa-radserver Custom RAD Server Module 
Dockerfile 
Build Command Lines 

III. RADServer + PAServer + InterBase Dockerfile 


Dockerfile 
Runtime Script 
Licensing 
Sample Build Scripts 
Build Command Lines 
 
4  

pa-radserver-ib Example Child Image 


Dockerfile 
Build Command Scripts 
pa-radserver-ib Custom RAD Server Module 
Dockerfile 
Build Command Lines 

Overview 
RAD Server is a REST based application platform for RAD Studio that can be used to rapidly 
build and deploy industry standard microservices. Docker is an OS-level virtualization 
environment that allows for the packaging and delivery of software like RAD Server as a bundle 
inside a container file. RAD Server has a number of binaries, configuration files, and a database 
that are required for it to run and all of these can be combined into a single Docker container 
that can be run by the Docker Engine. In addition to RAD Server other RAD Studio applications 
for Linux can also be deployed to the Docker containers through the RAD Studio Platform 
Assistant server. 

A variety of use cases for RAD Server Docker containers are achievable such as deploying a RAD 
Studio Linux console from the RAD Studio IDE and viewing PAServer’s output, deploying and 
installing a custom RAD Server resource module from the RAD Studio IDE via PAServer, 
clustering multiple RAD Server Docker container instances side by side, and even building a child 
Docker container based on one of the existing RAD Server Docker images as a parent that 
contains customs RAD Server resource modules. 

A number of Docker containers with various configurations have been made available for the 
Linux environment based on Ubuntu 18.04 to deploy RAD Studio Linux applications and custom 
RAD Server resource modules. Both Dockerfiles and pre-built Docker images are available. The 
radstudio/paserver​ container contains PAServer available on port 64211 and broadwayd 

 
5  
available on port 8082. The r​ adstudio/pa-radserver​ container has PAServer (64211), Apache 
(80), and broadwayd (8082). And finally, the ​radstudio/pa-radserver-ib​ container has 
PAServer (64211), RAD Server on Apache (80), broadwayd (8082), and the RAD Server database 
(InterBase) on port 3050. 

We are going to briefly cover each of the technologies used with the RAD Studio Docker 
containers including RAD Server, Docker, PAServer, Apache, and broadwayd before diving into 
the configuration and operation of the containers themselves. Let’s get started! 

What is RAD Server? 


RAD Server enables developers to quickly build new application back-ends or migrate existing 
Delphi or C++ client/server business logic to a modern services based architecture that is open, 
stateless, secure and scalable. RAD Server can be deployed to Windows on IIS, Apache, or stand 
alone. It can also be deployed to Linux on Apache or stand alone. The RAD Server database 
utilizes Embarcadero’s InterBase for storing it’s persistent data. Resource modules (containing 
a various number of custom endpoints) can be added to RAD Server. 

http://docwiki.embarcadero.com/RADStudio/Rio/en/RAD_Server_Overview 

What is Docker? 
Docker is an OS-level virtualization environment that allows for the packaging and delivery of 
software as a bundle inside a container file. The container files are executed by the Docker 
Engine and multiple containers can run side by side on the same Linux installation. Inside each 
container is an OS-level virtualization environment.  

Containers are more lightweight than virtual machines because they are run by Docker Engine. 
Containers are created by building a set of instructions called a Dockerfile into a container 
image. Container images are then executed on the Docker Engine. Both the build step and run 
step can take a number of arguments that configures that specific build or run container image. 

Additionally, existing container images can be used as starting points from within Dockerfiles 
which allows you to add new functionality on top of the functionality of the existing container 
image. 

https://www.docker.com/ 

 
6  

Portainer 
Docker instance management tools like Portainer are available to orchestrate Docker instances. 
Portainer itself runs within a Docker container and provides a web-based interface for managing 
multiple docker environments. It allows you to start and stop Docker instances, connect into the 
instance, and control other Docker features like Volumes. 

https://www.portainer.io/ 

Kubernetes 
Kubernetes is an orchestration system for Docker containers which allows you to coordinate 
clusters of container instances at scale. In this case Kubernetes would allow you to run 
orchestrate and coordinate multiple RAD Server Docker container instances in a variety of 
configurations. Example configurations might include multiple p
​ a-radserver​ Docker container 
instances connecting to a single RAD Server database (InterBase) Docker container instance or 
multiple p
​ a-radserver-ib​ Docker container instances running side by side, or even a cluster of 
paserver​ Docker container instances hosting a RAD Studio Linux application. 

Setup of Kubernetes can be complex but there are a number of third party guides available that 
can help you through the process like this Kubernetes Workship guide 
https://github.com/eon01/kubernetes-workshop​ which can help you set up a Kubernetes 
installation. 

https://kubernetes.io/ 

Docker Swarm 
Docker Swarm is a container image instance orchestration platform provided by Docker itself. 
Docker Swarm can be used to create, deploy and manage clusters of Docker nodes. It also 
provides features like redundancy, scheduling, failover, load balancing, and more. Similarly to 
Kubernetes, Docker Swarm example configurations might include multiple ​pa-radserver 
instances connecting to a ​pa-radserver-ib​ instance running in InterBase only mode. 

https://docs.docker.com/engine/swarm/  

What is Docker Hub? 

 
7  

Docker provides a service that allows developers and publishers to distribute Docker images 
to the public or their team. This service is known as Docker Hub and provides a way for users to 
use repositories where specific Docker Images are located. Docker repositories also allow for 
Docker Image versioning. Docker Hub contains official images such as the Ubuntu image that 
can be used as starting points for many users. Another feature that Docker Hub provides is 
Teams and Organizations. This allows for restricting access to Docker Images to only those in 
the organization or team.  

What is Platform Assistant (PAServer)? 


The Platform Assistant server (named paserver) is a command-line application that can be 
installed on Windows, OS X, and Linux. The Platform Assistant can be installed on a remote 
system to let RAD Studio interact with that remote system. Cross-platform (multi-device) 
applications can be developed, debugged, and deployed remotely for OS X, iOS, Linux, or Win64 
(this last from a Win32 development system). 

http://docwiki.embarcadero.com/RADStudio/en/PAServer,_the_Platform_Assistant_Server_Appl
ication 

What is Apache? 
Apache is an open-source HTTP server which enables third party add ons through the use of 
Modules. A RAD Server module is available for Apache which allows RAD Studio users to run 
RAD Server on Apache and deploy custom RAD Server endpoints to the web on Linux (and 
Windows). 

https://httpd.apache.org/ 

What is broadwayd? 
RAD Studio supports the development of Linux UI applications through FMXLinux. FMXLinux 
utilizes the multi-platform GTK+ toolkit for displaying RAD Studio applications on Linux. 
broadwayd is a display server for the Broadway GDK backend which allows for the display of 
GTK+ based applications in HTML5 via web sockets. Ultimately this means you can deploy 
Linux GUI applications in HTML5 through the broadwayd server. N
​ ote:​ Applications displayed 
through broadwayd from within a Docker container image instance that require certain OpenGL 

 
8  
operations may not support all functionality unless your Docker container image instance 
has full OpenGL support. 

https://developer.gnome.org/gtk3/stable/broadwayd.html 

Docker Containers 
The RAD Studio Docker containers p
​ aserver​, ​pa-radserver​, and p
​ a-radserver-ib​ are available 
directly from DockerHub and also as Dockerfiles plus additional helper utilities. When pulling the 
containers from DockerHub using Docker the organization name has to be prefixed to the 
container name such as r​ adstudio/paserver​, ​radstudio/pa-radserver​, and 
radstudio/pa-radserver-ib​. 

Docker containers have a number of different parameters that you can pass to the Docker 
Engine when starting an instance. Additionally, custom build and run parameters can be defined 
when building and running a Docker image. A number of custom parameters have been included 
for PAServer, RAD Server, and the RAD Server database (InterBase). These include parameters 
such as a password for PAServer, the RAD Server database address and port, and a production 
mode where PAServer and broadwayd are not enabled.  

Docker container instances can be run in the foreground where you can interact with an app that 
is running within the instance or they can be run detached in the background which behaves like 
a service.  

Docker container instances will not by default store any changes to the instance between runs. 
However, you can set up a persistent Volume within the Docker instance which will store 
changes between runs of the Docker container instance. A directory within the Docker instance 
can be mounted to the Volume and any changes made within that directory persist on the 
Volume between runs of the Docker instance. 

How To Install Docker 


The Docker system can be installed in a number of ways. One way to install Docker is to use the 
APT package manager that is included in the Ubuntu operating system. To install Docker using 

 
9  
APT simply run the ​apt install​ command with elevated privileges either by using sudo or by 
using the super user account.  

#if using sudo


sudo apt install docker.io

#if using super user account


apt install docker.io

paserver Docker 
The ​paserver​ Docker image uses Ubuntu:Bionic as a base image and builds on it to include the 
PAServer tool and its functionalities. The PAServer tool is downloaded from the Embarcadero 
server. This image contains PAServer and all of its dependencies along with the GTK+ 
framework for using BroadwayD. BroadwayD can be used to display GTK+ applications on the 
web via HTML5 and websockets. Having these two tools available on the same Docker 
container allows for developers to deploy console and GUI based applications using the 
PAServer and view the GUI applications through a web browser via the BroadwayD server.  

We will cover the custom build and run parameters that are available for this Docker image, 
some example build and run command lines, and finally some usage scenarios for this Docker 
instance. 

Build Parameters: 
--build-arg password=​[PASSWORD]​ allows a user to set the password for PAServer at 
build time. The default password set in the Dockerfile for PAServer is embtdocker. 

Example Build: 
docker build . --build-arg password=​securepass 

Run Parameters: 
-e PA_SERVER_PASSWORD=​[PASSWORD]​ allows a user to override the build time 
PAServer password and set the password for PAServer at run time.  

-it​ Foreground mode allows you to see and interact with PAServer from a command line 
interface. 

 
10  

-d​ Detached mode allows you to run the PAServer Docker container in the 
background. 

-p [​ EXTERNAL PA SERVER PORT]​:64211​ Defines an external port for PAServer (visible 


outside of the Docker container image instance) followed by the colon character 
followed by the internal port it is running on inside of the Docker container image 
instance. 

-p [​ EXTERNAL BROADWAYD PORT]​:8082​ Defines an external port for broadwayd (visible 


outside of the Docker container image instance) followed by the colon character 
followed by the internal port it is running on inside of the Docker container image 
instance. 

Example Run: 
docker pull radstudio/paserver 

docker run -it -e PA_SERVER_PASSWORD=​securepass​ -p ​64211​:64211 -p 8


​ 082​:8082 
radstudio/paserver 

Control Scripts: 
● Build.sh​ A script is provided to build a Docker container image with the Dockerfile. 
● Pull-run.sh​ A script is provided to pull the ​radstudio/paserver​ Docker container image 
from DockerHub and run a new Docker container image instance in the foreground.  
● Run.sh​ A script is provided to run a new Docker container image instance in the 
foreground. 
● Pull-run-production.sh​ A script is provided to pull the ​radstudio/paserver​ Docker 
container image from DockerHub and run a new Docker container image instance 
detached in production mode. The PAServer password must be passed as a parameter 
to the script. 
● Run-production.sh​ A script is provided to run a new Docker container image instance 
detached in production mode. The PAServer password must be passed as a parameter 
to the script. 

Usage Scenarios: 

 
11  

● Deploy a RAD Studio Linux console application from the RAD Studio IDE and view 
PAServer’s output via the paserver Docker container instance foreground mode. S
​ ee 
Usage Scenarios I.A. 
● Deploy a RAD Studio Linux GUI application from the RAD Studio IDE and view the 
application via HTML5 in a web browser on port 8082. ​See Usage Scenarios I.B. 
● Build a child Docker container via a custom Dockerfile using the ​paserver​ image as a 
parent. ​See Usage Scenarios I.C. 

pa-radserver Docker 
The ​pa-radserver​ Docker image uses Ubuntu:Bionic as a base image and adds the PAServer and 
RAD Server on Apache installation plus their configurations. The PAServer archive and the RAD 
Server Installer are downloaded from the Embarcadero server. This image contains all of the 
functionalities of the p
​ aserver​ image with the addition of RAD Server on Apache.  

This Docker container allows for developers to test, debug, and deploy Linux applications and 
custom RAD Server endpoints as well as deploying RAD Server in a production environment. 
Configuration options for this image include items such as the PAServer password and the RAD 
Server database (InterBase) location and port. Options can be specified at build time or at run 
time. 

We will cover the custom build and run parameters that are available for this Docker image, 
some example build and run command lines, and finally some usage scenarios for this Docker 
instance.  

Setup A Remote RAD Server database (InterBase) 


The RAD Server production installer can be used to install a RAD Server database (InterBase) on 
a host machine that can be connected to from the p
​ a-radserver​ Docker container image 
instances. The zip file is available through Embarcadero’s GetIt in the RAD Studio IDE. Simply 
download the RAD Server production installer and move it to the desired Linux machine. Next 
unzip the zip file that was moved to the linux machine.  

unzip RADServerInstallerLinux_1032.zip

Run the installer. 

 
12  

sudo sh ./radserver_install.sh 

When the installer is run, it should prompt the user to select what items can be installed. Press 
enter to continue the installation which will accept the default selected items. Once the installer 
is complete the RAD Server database (InterBase) installation should be ready. When 
pa-radserver​ image is run the hostname and port of the new RAD Server database (InterBase) 
installation can be used. 

Build Parameters: 
--build-arg password=​[PASSWORD]​ allows a user to set the password for PAServer at 
build time. The default password set in the Dockerfile for PAServer is embtdocker. 

--build-arg dbhost=​[INTERBASE HOST]​ allows a user to set the RAD Server database 
(InterBase) address number. Note: A hostname could also be used. 

--build-arg dbport=​[INTERBASE PORT]​ allows a user to set the RAD Server database 
(InterBase) port number. Note: A port name could also be used. 

Example Build: 
docker build --build-arg password=​securepass​ --build-arg dbhost=​127.0.0.1​ --build-arg 
dbport=​3050 

Run Parameters: 
-e PA_SERVER_PASSWORD=​[PASSWORD]​ allows a user to override the build time 
PAServer password and set the password for PAServer at run time.  

-it​ Foreground mode allows you to see and interact with PAServer from a command line 
interface. 

-d​ Detached mode allows you to run the PAServer Docker container in the background. 

-e CONFIG=PRODUCTION​ allows a user to disable PAServer and broadwayd for use in a 


production environment. 

 
13  

--mount source=​[EMS VOLUME NAME]​,target=/etc/ems​ allows a user to define the 


RAD Server directory containing the configuration files as a persistent volume within the 
container. 

-e DB_HOST=​[INTERBASE HOST]​ allows a user to override the build time RAD Server 
database (InterBase) address number. Note: A hostname could also be used. 

-e DB_PORT=​[INTERBASE PORT]​ allows a user to override the build time RAD Server 
database (InterBase) port number. Note: A port name could also be used. 

-p [​ EXTERNAL HTTP PORT]​:80​ Defines an external port for RAD Server on Apache 
(visible outside of the Docker container image instance) followed by the colon character 
followed by the internal port it is running on inside of the Docker container image 
instance. 

-p [​ EXTERNAL PA SERVER PORT]​:64211​ Defines an external port for PAServer (visible 


outside of the Docker container image instance) followed by the colon character 
followed by the internal port it is running on inside of the Docker container image 
instance. 

-p [​ EXTERNAL BROADWAYD PORT]​:8082​ Defines an external port for broadwayd (visible 


outside of the Docker container image instance) followed by the colon character 
followed by the internal port it is running on inside of the Docker container image 
instance. 

Example Run: 
docker pull radstudio/pa-radserver 

docker run -d --mount source=​ems​,target=/etc/ems -e DB_PORT=​3050​ -e 


DB_HOST=​127.0.0.1​ -e PA_SERVER_PASSWORD=​securepass​ -p ​80​:80 -p ​64211​:64211 -p 
8082​:8082 radstudio/pa-radserver 

Control Scripts: 
● Build.sh​ A script is provided to build a Docker container image with the Dockerfile. 

 
14  
● pull.sh​ A script is provided to pull the ​radstudio/pa-radserver​ Docker container 
image from DockerHub. 
● Pull-run.sh​ A script is provided to pull the ​radstudio/pa-radserver​ Docker container 
image from DockerHub and run a new Docker container image instance in the 
foreground. The RAD Server data (InterBase) hostname and port must be passed as 
parameters to the script. 
● Pull-run-production.sh​ A script is provided to pull the ​radstudio/pa-radserver​ Docker 
container image from DockerHub and run a Docker new container image instance 
detached in production mode. Both PAServer and broadwayd are not available in 
production mode. The RAD Server data (InterBase) hostname and port must be passed 
as parameters to the script. 
● Run.sh​ A script is provided to run a new Docker container image instance in the 
foreground. The RAD Server data (InterBase) hostname and port must be passed as 
parameters to the script. 
● Run-production.sh​ A script is provided to run a new Docker container image instance 
detached in production mode. Both PAServer and broadwayd are not available in 
production mode. The RAD Server data (InterBase) hostname and port must be passed 
as parameters to the script. 
● config.sh 
A configuration script is provided which can be run from the command line on the host 
machine where a RAD Server Docker container instance is running that will allow you to 
edit the emsserver.ini file of a running RAD Server Docker container and then restart 
Apache without having to restart the Docker container itself. If the Docker instance has a 
persistent volume these changes will last between runs of the instance. 

RADServerDockerDeploy Project: 
A RAD Studio project is provided which allows a developer to deploy custom RAD Server 
endpoints via a resource module into a running RAD Server Docker container image instance, 
automatically update the emsserver.ini file with the new resource module, and restart the 
Apache web server without having to restart the RAD Server Docker container image instance. If 
the Docker instance has a persistent volume these changes will last between runs of the 
instance. 

 
15  

1. Configure the Package Output Directory in P


​ roject|Options…|Building…|Delphi 
Compiler​ and set it to .​ \​ which will place the compiled package file in the same directory 
as the project files. 
2. Compile the RAD Server endpoint custom resource module project to generate the 
package file. 
3. Copy the ​RADServerDockerDeploy.dpr​ and R
​ ADServerDockerDeploy.dproj​ files (from 
https://github.com/Embarcadero/pa-radserver-docker​) into the same project directory. 
4. Open the R
​ ADServerDockerDeploy.dpr​ project. 
5. Go to ​Project|Resources and Images…|Add…​ and add your RAD Server endpoint custom 
resource module package as a resource with an Identifier of ‘Module’ and a Type of 
‘RCDATA’. 
6. Select the Linux target platform, verify that your connection settings for Linux 
deployment to a ​pa-radserver​ Docker container image instance are configured correctly, 
and ​Run Without Debugging​ the project. 
7. The RAD Server endpoint custom resource module package should now be installed in 
the p
​ a-radserver​ Docker container image instance.  
8. Verify the new endpoint in a web browser at ​{dockerimageip}/radserver/{endpoint}/ 

Usage Scenarios: 
● Deploy a RAD Studio Linux console application from the RAD Studio IDE and view 
PAServer’s output via the paserver Docker container instance foreground mode. S
​ ee 
Usage Scenarios II.A. 
● Deploy a RAD Studio Linux GUI application from the RAD Studio IDE and view the 
application via HTML5 in a web browser on port 8082. ​See Usage Scenarios II.B. 
● Deploy a RAD Server resource module from the RAD Studio IDE via PAServer, 
automatically install it into emsserver.ini, and restart the Apache web server. Changes 
can be persistent if a persistent volume is used. S
​ ee Usage Scenarios II.C. 
● Re-configure a running RAD Server Docker container instance through config.sh. 
Changes can be persistent if a persistent volume is used. ​See Usage Scenarios II.D. 
● Host multiple RAD Server Docker container instances that all remotely connect to a 
single RAD Server database (InterBase). ​See Usage Scenarios II.E. 

 
16  
● Build a child Docker container via a custom Dockerfile using the ​pa-radserver​ image 
as a parent. ​See Usage Scenarios II.F. 
● Build a child Docker container via a custom Dockerfile using the ​pa-radserver​ image as a 
parent that contains a custom RAD Server resource module. S
​ ee Usage Scenarios II.G. 

pa-radserver-ib Docker 
The ​pa-radserver-ib​ Docker image uses Ubuntu:Bionic as a base image and adds PAServer, RAD 
Server on Apache, and RAD Server database (InterBase) installation and their configurations. 
The PAServer archive and the RAD Server Installer are downloaded from the Embarcadero 
server. The p
​ a-radserver-ib​ Dockerfile can be configured to accept a RAD Server license SLIP 
file at build time which will create a fully licensed Docker container. Otherwise the 
pa-radserver-ib​ container should be run in foreground mode the first time so that you can add a 
RAD Server license. This image contains all of the functionalities of the p
​ a-radserver​ image with 
the addition of the RAD Server database (InterBase). This provides you with a single self 
contained instance of RAD Server. This image can be configured to run as a production 
environment by disabling PAServer and broadwayd. Options can be specified at build time or at 
run time.  

We will cover the custom build and run parameters that are available for this Docker image, 
some example build and run command lines, and finally some usage scenarios for this Docker 
instance. 

How To License The RAD Server Docker Container 


There are two different ways to license the stand alone p
​ a-radserver-ib​ Docker container image 
of RAD Server. The first method is to build the Dockerfile and have it take an existing distribution 
license slip file. The second method is to run an existing p
​ a-radserver-ib​ Docker container 
image instance in interactive mode, enter your RAD Server license number, and register it with 
Embarcadero. Both methods should be run with a persistent volume so that any changes to RAD 
Server including the license are saved between run instances. 

Add License Via Slip File At Build Time 


A slip can be utilized by editing the Dockerfile and making changes as suggested in the code. 

 
17  

Comment out the following RUN line as follows: 

#RUN touch ./radserverlicense.slip 

Uncomment the following COPY AND RUN lines as follows: 

COPY radserverlicense.slip ./radserverlicense.slip 


RUN chmod 644 ./radserverlicense.slip 

Make sure that an existing distribution license slip file for RAD Server is in the same directory as 
the Dockerfile and named radserverlicense.slip Once the two above steps are complete you can 
build the Docker image. 

Add License Via Serial Number And Registration At First Run 


A license can be added to the ​pa-radserver-ib​ Docker container image the first time the image 
is run. It must be run in interactive mode. The RAD Server database (InterBase) License 
Manager will show up and a serial number can be entered. The serial number will be registered 
and verified with Embarcadero. Once registration is complete the License Manager can be 
exited, RAD Server will complete its setup, and the Docker container image instance should be 
ready to use. 

Build Parameters: 
--build-arg password=​[PASSWORD]​ Allows a user to set the password for PAServer at 
build time. The default password set in the Dockerfile for PAServer is embtdocker. 

Example Build: 
docker build . --build-arg password=​securepass 

Run Parameters: 
-e PA_SERVER_PASSWORD=​[PASSWORD]​ Allows a user to override the build time 
PAServer password and set the password for PAServer at run time.  

-it​ Foreground mode allows you to see and interact with PAServer from a command line 
interface. 

-d​ Detached mode allows you to run the PAServer Docker container in the background. 

 
18  

-e CONFIG=PRODUCTION​ Allows you to disable PAServer and broadwayd for use in 
a production environment. 

-e CONFIG=INTERBASE​ Allows you to disable PAServer, broadwayd, and RAD Server on 
Apache for use in a production RAD Server database (InterBase) only environment. 

--mount source=​[INTERBASE VOLUME NAME]​,target=/opt/interbase​ Allows a user to 


define the RAD Server database (InterBase) directory containing the InterBase files as a 
persistent volume within the container. 

--mount source=​[EMS VOLUME NAME]​,target=/etc/ems​ Allows a user to define the RAD 


Server directory containing the configuration and database files as a persistent volume 
within the container. 

-p [​ EXTERNAL HTTP PORT]​:80​ Defines an external port for RAD Server on Apache 
(visible outside of the Docker container image instance) followed by the colon character 
followed by the internal port it is running on inside of the Docker container image 
instance. 

-p [​ EXTERNAL PA SERVER PORT]​:64211​ Defines an external port for PAServer (visible 


outside of the Docker container image instance) followed by the colon character 
followed by the internal port it is running on inside of the Docker container image 
instance. 

-p [​ EXTERNAL BROADWAYD PORT]​:8082​ Defines an external port for broadwayd (visible 


outside of the Docker container image instance) followed by the colon character 
followed by the internal port it is running on inside of the Docker container image 
instance. 

-p [​ EXTERNAL INTERBASE PORT]​:3050​ Defines an external port for the RAD Server 
database (InterBase) (visible outside of the Docker container image instance) followed 
by the colon character followed by the internal port it is running on inside of the Docker 
container image instance. 

Example Run: 
docker pull radstudio/pa-radserver-ib 

 
19  

docker run -it -e PA_SERVER_PASSWORD=​securepass​ -p ​80​:80 -p ​64211​:64211 -p 


8082​:8082 -p ​3050​:3050 --mount source=​interbase​,target=/opt/interbase --mount 
source=​ems​,target=/etc/ems radstudio/pa-radserver-ib 

Control Scripts: 
● build.sh​ A script is provided to build a Docker container image with the Dockerfile. 
● pull.sh​ A script is provided to pull the ​pa-radserver-ib​ Docker container image from 
DockerHub. 
● pull-run.sh​ A script is provided to pull the ​pa-radserver-ib​ Docker container image from 
DockerHub and run a new Docker container image instance in the foreground. Instance 
must be licensed on first run. 
● run.sh​ A script is provided to run a new Docker container image instance in the 
foreground. Instance must be licensed on first run. 
● run-production.sh​ A script is provided to run a new Docker container image instance 
detached in production mode. Both PAServer and broadwayd are not available in 
production mode. Instance must be licensed before using this script. 
● run-interbase-only.sh​ A script is provided to run a new Docker container image instance 
detached in InterBase mode. PAServer, broadwayd, and RAD Server on Apache are not 
available in InterBase mode. Instance must be licensed before using this script. 
● config.sh​ A configuration script is provided which can be run from the command line on 
the host machine where a RAD Server Docker container instance is running that will 
allow you to edit the emsserver.ini file of a running RAD Server Docker container and 
then restart Apache without having to restart the Docker container itself. If the Docker 
instance has a persistent volume these changes will last between runs of the instance. 

RADServerDockerDeploy Project: 
A RAD Studio project is provided which allows a developer to deploy custom RAD Server 
endpoints via a resource module into a running RAD Server Docker container, automatically 
update the emsserver.ini file with the new resource module, and restart the Apache web server 
without having to restart the RAD Server Docker container instance. If the Docker instance has a 
persistent volume these changes will last between runs of the instance. 

 
20  

9. Configure the Package Output Directory in P


​ roject|Options…|Building…|Delphi 
Compiler​ and set it to .​ \​ which will place the compiled package file in the same directory 
as the project files. 
10. Compile the RAD Server endpoint custom resource module project to generate the 
package file. 
11. Copy the ​RADServerDockerDeploy.dpr​ and R
​ ADServerDockerDeploy.dproj​ files (from 
https://github.com/Embarcadero/pa-radserver-ib-docker​) into the same project 
directory. 
12. Open the R
​ ADServerDockerDeploy.dpr​ project. 
13. Go to ​Project|Resources and Images…|Add…​ and add your RAD Server endpoint custom 
resource module package as a resource with an Identifier of ‘Module’ and a Type of 
‘RCDATA’. 
14. Select the Linux target platform, verify that your connection settings for Linux 
deployment to a ​pa-radserver-ib​ Docker container image instance are configured 
correctly, and ​Run Without Debugging​ the project. 
15. The RAD Server endpoint custom resource module package should now be installed in 
the p
​ a-radserver-ib​ Docker container image instance.  
16. Verify the new endpoint in a web browser at ​{dockerimageip}/radserver/{endpoint}/ 

Usage Scenarios: 
● Deploy a RAD Studio Linux console application from the RAD Studio IDE and view 
PAServer’s output via the paserver Docker container instance foreground mode. S
​ ee 
Usage Scenarios III.A. 
● Deploy a RAD Studio Linux GUI application from the RAD Studio IDE and view the 
application via HTML5 in a web browser on port 8082. ​See Usage Scenarios III.B. 
● Deploy a RAD Server resource module from the RAD Studio IDE via PAServer, 
automatically install it into emsserver.ini, and restart the Apache web server. Changes 
can be persistent if a persistent volume is used. S
​ ee Usage Scenarios III.C. 
● Re-configure a running RAD Server Docker container instance through config.sh. 
Changes can be persistent if a persistent volume is used. ​See Usage Scenarios III.D. 
● Deploy a RAD Server production instance without PAServer and broadwayd. ​See Usage 
Scenarios III.E. 

 
21  
● Deploy a RAD Server database (InterBase) production instance without PAServer, 
broadwayd, and Apache. S
​ ee Usage Scenarios III.F. 
● Host multiple RAD Server Docker container instances that each have their own RAD 
Server database (InterBase). S
​ ee Usage Scenarios III.G. 
● Build a child Docker container via a custom Dockerfile using the ​pa-radserver-ib​ image 
as a parent. ​See Usage Scenarios III.H. 
● Build a child Docker container via a custom Dockerfile using the ​pa-radserver-ib​ image 
as a parent that contains a custom RAD Server resource module. ​See Usage Scenarios 
III.I. 

Usage Scenarios 
paserver Scenarios: 
I.A Deploy a RAD Studio Linux console application from the RAD Studio IDE and view 
PAServer’s output via the paserver Docker container instance foreground mode.  
1. Run the paserver Docker image in foreground mode by using the ​-it​ parameter.

docker run -it -e PA_SERVER_PASSWORD=securepass -p 64211:64211 -p


8082:8082 radstudio/paserver
2. Configure the connection to the paserver Docker instance. 
http://docwiki.embarcadero.com/RADStudio/Rio/en/Create_a_Connection_Profile 
3. Select the new target platform. 
http://docwiki.embarcadero.com/RADStudio/Rio/en/Activating_and_Configuring_the_Ta
rget_Platform 
4. Deploy from RAD Studio by clicking the Run button. 

I.B Deploy a RAD Studio Linux GUI application from the RAD Studio IDE and view the 
application via HTML5 in a web browser on port 8082. 

 
22  

1. Run the paserver Docker image in foreground mode by using the ​-it​ parameter.

docker run -it -e PA_SERVER_PASSWORD=securepass -p 64211:64211 -p


8082:8082 radstudio/paserver
2. Configure the connection to the paserver Docker instance. 
http://docwiki.embarcadero.com/RADStudio/Rio/en/Create_a_Connection_Profile 
3. Select the new target platform. 
http://docwiki.embarcadero.com/RADStudio/Rio/en/Activating_and_Configuring_the_Ta
rget_Platform 
4. Deploy from RAD Studio by clicking the Run button. 
5. Connect to the Docker instance on port 8082 to view the GUI application. 

I.C Build a child Docker container via a custom Dockerfile using the paserver image as 
a parent. 
1. Use the dockerfile below to build a child image. 

FROM​ radstudio/paserver
RUN​ apt-get update && apt-get install nano 
2. Build the image. 

docker build . -t paserver-child 


3. Run the image. 

docker run -it -e PA_SERVER_PASSWORD=securepass -p 64211:64211 -p


8082:8082 paserver-child 
4. Configure the connection to the paserver Docker instance. 
http://docwiki.embarcadero.com/RADStudio/Rio/en/Create_a_Connection_Profile 
5. Select the new target platform. 
http://docwiki.embarcadero.com/RADStudio/Rio/en/Activating_and_Configuring_the_Ta
rget_Platform 
6. Deploy from RAD Studio by clicking the Run button. 

pa-radserver Scenarios: 
II.A Deploy a RAD Studio Linux console application from the RAD Studio IDE and view 
PAServer’s output via the paserver Docker container instance foreground mode. 

 
23  

1. Run the ​pa-radserver​ Docker image in foreground mode by using the -​ it​ parameter.

docker run -it -e PA_SERVER_PASSWORD=securepass -e dbhost=127.0.0.1


-e dbport=3050 -p 64211:64211 -p 8082:8082 -p 80:80
radstudio/pa-radserver
2. Configure the connection to the paserver Docker instance. 
http://docwiki.embarcadero.com/RADStudio/Rio/en/Create_a_Connection_Profile 
3. Select the new target platform. 
http://docwiki.embarcadero.com/RADStudio/Rio/en/Activating_and_Configuring_the_Ta
rget_Platform 
4. Deploy from RAD Studio by clicking the Run button. 

II.B Deploy a RAD Studio Linux GUI application from the RAD Studio IDE and view the 
application via HTML5 in a web browser on port 8082. 
1. Run the ​pa-radserver​ Docker image in foreground mode by using the -​ it​ parameter.

docker run -it -e PA_SERVER_PASSWORD=securepass -e dbhost=127.0.0.1


-e dbport=3050 -p 64211:64211 -p 8082:8082 -p 80:80
radstudio/pa-radserver
2. Configure the connection to the paserver Docker instance. 
http://docwiki.embarcadero.com/RADStudio/Rio/en/Create_a_Connection_Profile 
3. Select the new target platform. 
http://docwiki.embarcadero.com/RADStudio/Rio/en/Activating_and_Configuring_the_Ta
rget_Platform 
4. Deploy from RAD Studio by clicking the Run button. 
5. Connect to the Docker instance on port 8082 to view the GUI application. 

II.C Deploy a RAD Server resource module from the RAD Studio IDE via PAServer, 
automatically install it into emsserver.ini, and restart the Apache web server. Changes 
can be persistent if a persistent volume is used. 
1. Run the ​pa-radserver​ Docker image in foreground mode by using the -​ it​ parameter.

docker run -it --mount source=ems,target=/etc/ems/ -e


PA_SERVER_PASSWORD=securepass -e dbhost=127.0.0.1 -e dbport=3050 -p
64211:64211 -p 8082:8082 -p 80:80 radstudio/pa-radserver

 
24  
2. Create and build a custom RAD Server resource module in the RAD Studio IDE. 
http://docwiki.embarcadero.com/RADStudio/Rio/en/Creating_a_RAD_Server_Package 
3. Open RADServerDockerDeploy.dpr project in the RAD Studio IDE. 
4. Add your custom RAD Server resource module to the project as a resource through the 
Project|Resources and Images…|Add…. Be sure to set Identifier to ‘Module’ and Type to 
‘RCDATA’. 
5. Configure the connection to the pa-radserver Docker instance. 
http://docwiki.embarcadero.com/RADStudio/Rio/en/Create_a_Connection_Profile 
6. Select the Linux 64 target platform. 
http://docwiki.embarcadero.com/RADStudio/Rio/en/Activating_and_Configuring_the_Ta
rget_Platform 
7. Deploy from RAD Studio by clicking the Run button. 
8. Connect to the newly deployed RAD Server endpoint in the custom resource module now 
hosted within the Docker instance at /radserver/{endpoint}. 

II.D Re-configure a running RAD Server Docker container instance through config.sh. 
Changes can be persistent if a persistent volume is used. 
1. Run the ​pa-radserver​ Docker image in detached mode by using the -​ d​ parameter.

docker run -d --mount source=ems,target=/etc/ems/ -e


PA_SERVER_PASSWORD=securepass -e dbhost=127.0.0.1 -e dbport=3050 -p
64211:64211 -p 8082:8082 -p 80:80 radstudio/pa-radserver
2. When the previous command is run docker will output a container id. Use the container 
id when calling the config.sh script. 

sh config.sh b0c1b241c0fa 
3. Make the desired changes to the emsserver.ini file. 
4. Connect to the Docker instance on http port 80 to view the change. 

II.E Host multiple RAD Server Docker container instances that all remotely connect to a 
single RAD Server database (InterBase). 
1. Create the database first. Run the p
​ a-radserver-ib​ Docker image in detached mode by 
using the ​-d​ and -e CONFIG=PRODUCTION parameters.

docker run -it -e CONFIG=INTERBASE -p 3050:3050 --mount


source=interbase,target=/opt/interbase --mount

 
25  

source=ems,target=/etc/ems radstudio/pa-radserver-ib
2. Enter the RAD Server database (InterBase) license at the License Manager prompt. 
3. Now that the Docker RAD Server database (InterBase) is licensed you can end the 
Docker instance. 
4. Run the ​pa-radserver-ib​ Docker container image instance in the background 

docker run -d -e CONFIG=INTERBASE -p 3050:3050 --mount


source=interbase,target=/opt/interbase --mount
source=ems,target=/etc/ems radstudio/pa-radserver-ib 
5. Interbase can be accessed at port 3050 
6. Run the ​pa-radserver​ Docker image in detached mode by using the -​ d ​parameter and 
have it connect to the p
​ a-radserver-ib​ instance. Multiple times on the same or multiple 
Docker hosts.

docker run -d --mount source=ems,target=/etc/ems/ -e


PA_SERVER_PASSWORD=securepass -e dbhost=127.0.0.1 -e dbport=3050 -p
64211:64211 -p 8082:8082 -p 80:80 radstudio/pa-radserver
7. Connect to the Docker instances on http port 80 to view RAD Server. 
8. Optional: Set up a load balancer to balance the traffic between the multiple instances. 

II.F Build a child Docker container via a custom Dockerfile using the pa-radserver 
image as a parent. 
1. Use the dockerfile below to build a child image. 

FROM​ radstudio/pa-radserver
RUN​ apt-get update && apt-get install nano 
2. Build the image. 

docker build . -t pa-radserver-child 


3. Run the image. 

docker run -d --mount source=ems,target=/etc/ems/ -e


PA_SERVER_PASSWORD=securepass -e dbhost=127.0.0.1 -e dbport=3050 -p
64211:64211 -p 8082:8082 -p 80:80 radstudio/pa-radserver 
4. Connect to the Docker instance on http port 80 to view RAD Server. 

 
26  

II.G Build a child Docker container via a custom Dockerfile using the pa-radserver 
image as a parent that contains a custom RAD Server resource module. Note: the 
custom module must be located in the same directory as the dockerfile. 
1. Use the dockerfile below to build a child image. 

FROM radstudio/pa-radserver

ARG password=embtdocker
ARG ModuleName=module
ARG ModuleFile
ARG dbhost
ARG dbport
ENV PA_SERVER_PASSWORD=$password
ENV DB_HOST=$dbhost
ENV DB_PORT=$dbport

COPY ​$ModuleFile​ /etc/ems/​$ModuleFile

RUN ​echo​ ​"#!/bin/bash"​ > ./emsscript.sh

#populate emsserver.ini with module data


ARG FindValue=:a;N;\$!ba;s​#\\\[Server\\\.Packages\\\]
ARG ReplaceValue=​#\\\[Server\\\.Packages\\\]
ARG ForwardSlash=/
ARG PoundG=​#g
ARG EmsIni=/etc/ems/emsserver.ini
RUN ​echo​ -n ​"sed -i '"​ >> ./emsscript.sh
RUN ​echo​ -n ​"​$FindValue​"​ >> ./emsscript.sh
RUN ​echo​ -n ​"\\"​ >> ./emsscript.sh
RUN ​echo​ -n ​"n"​ >> ./emsscript.sh
RUN ​echo​ -n ​"​$ReplaceValue​"​ >> ./emsscript.sh
RUN ​echo​ -n ​"\\"​ >> ./emsscript.sh
RUN ​echo​ -n ​"n"​ >> ./emsscript.sh
RUN ​echo​ -n ​"/etc/ems/​$ModuleFile​=​$ModuleName​"​ >> ./emsscript.sh
RUN ​echo​ -n ​"​$PoundG​' "​ >> ./emsscript.sh
RUN ​echo​ -n ​"​$EmsIni​"​ >> ./emsscript.sh
RUN ​echo​ ​""​ >> ./emsscript.sh
RUN sh ./emsscript.sh
2. Build the image. 

 
27  

docker build . -t pa-radserver-child --build-arg


ModuleFile=bplProject1.so 
3. Run the image. 

docker run -d --mount source=ems,target=/etc/ems/ -e


PA_SERVER_PASSWORD=securepass -e dbhost=127.0.0.1 -e dbport=3050 -p
64211:64211 -p 8082:8082 -p 80:80 pa-radserver-child 
4. Connect to the Docker instance on http port 80 to view the custom module at 
/radserver/{endpoint}. 

pa-radserver-ib Scenarios 
III.A Deploy a RAD Studio Linux console application from the RAD Studio IDE and view 
PAServer’s output via the paserver Docker container instance foreground mode. 
1. Run the ​pa-radserver-ib​ Docker image in foreground mode by using the -​ it​ parameter.

docker run -it -e PA_SERVER_PASSWORD=securepass -p 80:80 -p


64211:64211 -p 8082:8082 -p 3050:3050 --mount
source=interbase,target=/opt/interbase --mount
source=ems,target=/etc/ems radstudio/pa-radserver-ib
2. Configure the connection to the paserver Docker instance. 
http://docwiki.embarcadero.com/RADStudio/Rio/en/Create_a_Connection_Profile 
3. Select the new target platform. 
http://docwiki.embarcadero.com/RADStudio/Rio/en/Activating_and_Configuring_the_Ta
rget_Platform 
4. Deploy from RAD Studio by clicking the Run button. 

III.B Deploy a RAD Studio Linux GUI application from the RAD Studio IDE and view the 
application via HTML5 in a web browser on port 8082. 
1. Run the ​pa-radserver-ib​ Docker image in foreground mode by using the -​ it​ parameter.

docker run -it -e PA_SERVER_PASSWORD=securepass -p 80:80 -p


64211:64211 -p 8082:8082 -p 3050:3050 --mount
source=interbase,target=/opt/interbase --mount
source=ems,target=/etc/ems radstudio/pa-radserver-ib

 
28  
2. Configure the connection to the paserver Docker instance. 
http://docwiki.embarcadero.com/RADStudio/Rio/en/Create_a_Connection_Profile 
3. Select the new target platform. 
http://docwiki.embarcadero.com/RADStudio/Rio/en/Activating_and_Configuring_the_Ta
rget_Platform 
4. Deploy from RAD Studio by clicking the Run button. 
5. Connect to the Docker instance on port 8082 to view the GUI application. 

III.C Deploy a RAD Server resource module from the RAD Studio IDE via PAServer, 
automatically install it into emsserver.ini, and restart the Apache web server. Changes 
can be persistent if a persistent volume is used. 
9. Run the ​pa-radserver-ib​ Docker image in foreground mode by using the -​ it​ parameter.

docker run -it -e PA_SERVER_PASSWORD=securepass -p 80:80 -p


64211:64211 -p 8082:8082 -p 3050:3050 --mount
source=interbase,target=/opt/interbase --mount
source=ems,target=/etc/ems radstudio/pa-radserver-ib
10. Create and build a custom RAD Server resource module in the RAD Studio IDE. 
http://docwiki.embarcadero.com/RADStudio/Rio/en/Creating_a_RAD_Server_Package 
11. Open RADServerDockerDeploy.dpr project in the RAD Studio IDE. 
12. Add your custom RAD Server resource module to the project as a resource through the 
Project|Resources and Images…|Add…​. Be sure to set Identifier to ‘Module’ and Type to 
‘RCDATA’. 
13. Configure the connection to the pa-radserver Docker instance. 
http://docwiki.embarcadero.com/RADStudio/Rio/en/Create_a_Connection_Profile 
14. Select the Linux 64 target platform. 
http://docwiki.embarcadero.com/RADStudio/Rio/en/Activating_and_Configuring_the_Ta
rget_Platform 
15. Deploy from RAD Studio by clicking the R
​ un Without Debugging​ button. 
16. Connect to the newly deployed RAD Server endpoint in the custom resource module now 
hosted within the Docker instance at /radserver/{endpoint}. 

III.D Re-configure a running RAD Server Docker container instance through config.sh. 
Changes can be persistent if a persistent volume is used. 
1. Run the ​pa-radserver-ib​ Docker image in detached mode by using the ​-d​ parameter.

 
29  

docker run -d -e PA_SERVER_PASSWORD=securepass -p 80:80 -p


64211:64211 -p 8082:8082 -p 3050:3050 --mount
source=interbase,target=/opt/interbase --mount
source=ems,target=/etc/ems radstudio/pa-radserver-ib
2. When the previous command is run docker will output a container id. Use the container 
id when calling the config.sh script. 

sh config.sh b0c1b241c0fa 
3. Make the desired changes to the emsserver.ini file. 
4. Connect to the Docker instance on http port 80 to view the change. 

III.E Deploy a RAD Server production instance without PAServer and broadwayd. 
1. Run the ​pa-radserver-ib​ Docker image in detached mode by using the ​-d​ and -e 
CONFIG=PRODUCTION parameters.

docker run -d -e CONFIG=PRODUCTION -p 80:80 -p 3050:3050 --mount


source=interbase,target=/opt/interbase --mount
source=ems,target=/etc/ems radstudio/pa-radserver-ib
2. Connect to the Docker instance on http port 80 to view the change. 

III.F Deploy a RAD Server database (InterBase) production instance without PAServer, 
broadwayd, and Apache. 
1. Run the ​pa-radserver-ib​ Docker image in detached mode by using the ​-d​ and -e 
CONFIG=PRODUCTION parameters.

docker run -d -e CONFIG=INTERBASE -p 3050:3050 --mount


source=interbase,target=/opt/interbase --mount
source=ems,target=/etc/ems radstudio/pa-radserver-ib
2. Interbase can be accessed at port 3050 

III.G Host multiple RAD Server Docker container instances that each have their own 
RAD Server database (InterBase). Note: Each pa-radserver-ib Docker uses a license. 
You can only run as many pa-radserver-ib Docker container image instances as your 
license allows. 
1. It is recommended to use an orchestration tool such as Kubernetes, Portainer, or Docker 
Swarm to deploy and orchestrate this scenario. Note: Each instance must be licensed 
before usage. 

 
30  
2. The container image instance can be licensed by running the ​pa-radserver-ib​ Docker 
image in foreground mode using the ​-it​ parameter. Optionally, if building from 
Dockerfile a distribution license slip file can be included.

docker run -it -e PA_SERVER_PASSWORD=securepass -p 80:80 -p


64211:64211 -p 8082:8082 -p 3050:3050 --mount
source=interbase,target=/opt/interbase --mount
source=ems,target=/etc/ems radstudio/pa-radserver-ib

111.H Build a child Docker container via a custom Dockerfile using the pa-radserver-ib 
image as a parent. 
1. Use the dockerfile below to build a child image. 

FROM radstudio/pa-radserver-ib

ARG password
ENV PA_SERVER_PASSWORD=$password
RUN apt-get update && apt-get install nano
2. Build the image. 

docker build . --build-arg password=securepass -t


pa-radserver-ib-child
3. Run the image. 

docker run -it -p 80:80 -p 64211:64211 -p 8082:8082 -p 3050:3050


--mount ​source​=interbase,target=/opt/interbase --mount
source​=ems,target=/etc/ems pa-radserver-ib-child
4. Connect to the Docker instance on http port 80 to view RAD Server. 

III.I Build a child Docker container that includes a custom module via a custom 
Dockerfile using the pa-radserver-ib image as a parent. 
5. Use the dockerfile below to build a child image. 

FROM radstudio/pa-radserver-ib

ARG password=embtdocker
ARG modulefile
ENV PA_SERVER_PASSWORD=$password

COPY ​$modulefile​ /etc/ems/module.so

 
31  
6. Build the image. 

docker build . --build-arg password=securepass --build-arg


ModuleFile=bplProject1.so -t pa-radserver-ib-custom-module
7. Run the image. 

docker run -it -e PA_SERVER_PASSWORD=securepass -p 80:80 -p


64211:64211 -p 8082:8082 -p 3050:3050 --mount
source​=interbase,target=/opt/interbase --mount
source​=ems,target=/etc/ems pa-radserver-ib-custom-module
8. Connect to the Docker instance on http port 80 to view RAD Server. 

Appendix 
I. PAServer Dockerfile 
The PAServer (​paserver​) Dockerfile is contained below and includes the instructions 
which are used at build time by Docker to create the Docker image. The Dockerfile relies 
on a specific version of PAServer that is downloaded from Embarcadero at build time. It 
can be updated to support future releases by updating the URL of the PAServer archive. 
The default password for paserver is set to ‘embtdocker’ as can be seen defined below. 

https://github.com/Embarcadero/paserver-docker 

Dockerfile 
FROM​ ubuntu:bionic

ARG​ password=embtdocker
ENV​ PA_SERVER_PASSWORD=$password
ADD
http://altd.embarcadero.com/releases/studio/20.0/PAServer/Release2/Li
nuxPAServer20.0.tar.gz ./paserver.tar.gz
COPY​ paserver_docker.sh ./paserver_docker.sh
RUN​ tar xvzf paserver.tar.gz

 
32  

RUN​ mv PAServer-20.0/* .
RUN​ apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -yy
install xorg libgl1-mesa-dev libosmesa-dev libgtk-3-bin
build-essential libcurl3 libcurl-openssl1.0-dev
RUN​ chmod +x paserver_docker.sh
EXPOSE​ ​64211
EXPOSE​ ​8082
CMD​ ./paserver_docker.sh 

The Dockerfile relies on the paserver_docker.sh script which is contained below. The 
paserver_docker.sh script is executed at runtime when the Docker instance is run. As 
can be seen in the script the broadwayd server and paserver are started. The script 
watches the paserver process to make sure it is still running. Once the paserver process 
terminates the Docker instance will also end.  

Runtime Script (radserver_docker.sh) 


#!/bin/bash

nohup broadwayd :2 &


export​ GDK_BACKEND=broadway
export​ BROADWAY_DISPLAY=:2
./paserver -password=​$PA_SERVER_PASSWORD
status=$?
if​ [ ​$status​ -ne 0 ]; ​then
​echo​ ​"Failed to start paserver: ​$status​"
​exit​ ​$status
fi
while​ sleep 10; ​do
ps aux |grep paserver |grep -q -v grep
PA_SERVER_STATUS=$?
​echo​ ​$PA_SERVER_STATUS
​if​ [ ​$PA_SERVER_STATUS​ -eq 0 ]; ​then
​echo​ ​"Complete!"
​exit​ 1
​fi

 
33  

done

A. Sample Build And Run Commands 


The sample Dockerfile build and run commands listed below can be used to create and 
run an image that has PAServer installed along with the required libraries to use the GTK 
broadwayd display server. 

   

 
34  

# standard build
docker build .
# standard build with the build arg for the PAServer password
docker build . --build-arg password=securepass

# run detached in the background with the default PAServer password


docker run -d -p [PA SERVER PORT]:64211 -p [BROADWAYD PORT]:8082
radstudio/paserver

# run detached in the background and specify the PAServer password


docker run -d -e PA_SERVER_PASSWORD=[PASSWORD] -p [PA SERVER
PORT]:64211 -p [BROADWAYD PORT]:8082 radstudio/paserver

# run in the foreground with the default PAServer password


docker run -it -p [PA SERVER PORT]:64211 -p [BROADWAYD PORT]:8082
radstudio/paserver

# run in the foreground and specify the PAServer password


docker run -it -e PA_SERVER_PASSWORD=[PASSWORD] -p [PA SERVER
PORT]:64211 -p [BROADWAYD PORT]:8082 radstudio/paserver 

   

 
35  

II. RADServer + PAServer Dockerfile 


The RADServer + PAServer (​pa-radserver​) Dockerfile is contained below and includes the 
instructions which are used at build time by Docker to create the Docker image. The 
Dockerfile relies on a specific version of the RAD Server production installer and 
PAServer that are downloaded from Embarcadero at build time. It can be updated to 
support future releases by updating the URLs of the RAD Server production installer and 
the PAServer archive. The default password for paserver is set to ‘embtdocker’ as can be 
seen defined below. 

https://github.com/Embarcadero/pa-radserver-docker 

Dockerfile 
FROM ubuntu:bionic

ARG dbhost=localhost
ARG dbport=​3050
ARG password=embtdocker
ENV DB_HOST=$dbhost
ENV DB_PORT=$dbport
ENV PA_SERVER_PASSWORD=$password
COPY radserver_docker.sh ./radserver_docker.sh
#INSTALL APACHE AND OTHER LIBS
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -yy
install --no-install-recommends \
apache2 \
unzip \
xorg libgl1-mesa-dev libosmesa-dev libgtk-3-bin build-essential
libcurl3 libcurl-openssl1.0-dev \
&& apt-get -y autoremove \
&& apt-get -y autoclean
#====END OTHER LIBS
#====GET ZIP FILES====
ADD
http://altd.embarcadero.com/getit/public/libraries/RADServer/RADServerI
nstallerLinux_1032.zip ./radserver.zip
ADD
http://altd.embarcadero.com/releases/studio/20.0/PAServer/Release2/Linu
xPAServer20.0.tar.gz ./paserver.tar.gz
RUN unzip radserver.zip

 
36  

RUN tar xvzf paserver.tar.gz


#========END ZIP FILES
RUN touch ./radserverlicense.slip
RUN sh ./radserver_install.sh -silent
RUN mv PAServer-20.0/* .
#populate emsserver.ini with interbase connection data
RUN cp /etc/ems/objrepos/emsserver.ini /etc/ems/emsserver.ini
RUN ​echo​ ​"#!/bin/bash"​ > ./emsscript.sh
RUN ​echo​ ​"sed -i 's/\\\r\$//' /etc/ems/emsserver.ini"​ >> ./emsscript.sh
RUN ​echo​ ​"sed -i
':a;N;\$!ba;s#\\\[!DBINSTANCENAME\\\]\\\n#​$dbhost$ForwardSlash$dbport​\\
\n#g' /etc/ems/emsserver.ini"​ >> ./emsscript.sh
RUN ​echo​ ​"sed -i
':a;N;\$!ba;s#\\\[!DBPATH\\\]\\\n#/etc/ems/emsserver.ib\\\n#g'
/etc/ems/emsserver.ini"​ >> ./emsscript.sh
RUN ​echo​ ​"sed -i ':a;N;\$!ba;s#\\\[!DBUSERNAME\\\]\\\n#sysdba\\\n#g'
/etc/ems/emsserver.ini"​ >> ./emsscript.sh
RUN ​echo​ ​"sed -i ':a;N;\$!ba;s#\\\[!DBPASSWORD\\\]\\\n#masterkey\\\n#g'
/etc/ems/emsserver.ini"​ >> ./emsscript.sh
RUN ​echo​ ​"sed -i ':a;N;\$!ba;s#\\\[!MASTERSECRET\\\]\\\n# \\\n#g'
/etc/ems/emsserver.ini"​ >> ./emsscript.sh
RUN ​echo​ ​"sed -i ':a;N;\$!ba;s#\\\[!APPSECRET\\\]\\\n# \\\n#g'
/etc/ems/emsserver.ini"​ >> ./emsscript.sh
RUN ​echo​ ​"sed -i ':a;N;\$!ba;s#\\\[!APPLICATIONID\\\]\\\n# \\\n#g'
/etc/ems/emsserver.ini"​ >> ./emsscript.sh
RUN ​echo​ ​"sed -i ':a;N;\$!ba;s#\\\[!SERVERPORT\\\]\\\n#8080\\\n#g'
/etc/ems/emsserver.ini"​ >> ./emsscript.sh
RUN ​echo​ ​"sed -i
':a;N;\$!ba;s#\\\[!CONSOLEUSER\\\]\\\n#consoleuser\\\n#g'
/etc/ems/emsserver.ini"​ >> ./emsscript.sh
RUN ​echo​ ​"sed -i
':a;N;\$!ba;s#\\\[!CONSOLEPASS\\\]\\\n#consolepass\\\n#g'
/etc/ems/emsserver.ini"​ >> ./emsscript.sh
RUN ​echo​ ​"sed -i ':a;N;\$!ba;s#\\\[!CONSOLEPORT\\\]\\\n#8081\\\n#g'
/etc/ems/emsserver.ini"​ >> ./emsscript.sh
RUN ​echo​ ​"sed -i
':a;N;\$!ba;s#\\\[!RESOURCESFILES\\\]\\\n#/etc/ems/objrepos\\\n#g'
/etc/ems/emsserver.ini"​ >> ./emsscript.sh
RUN sh ./emsscript.sh
#=============================end ems population
RUN sed -e ​'/\/opt\/interbase\/bin\/ibmgr/ { N; d; }'​ /tmp/rssetup.sh
-i

 
37  

RUN sh /tmp/rssetup.sh swaggerui RS,RC,SUI


RUN sh /tmp/apachesetup.sh radserver radconsole RS,RC
#=====CLEAN UP==========
RUN rm RADServer.bin
RUN rm radserverlicense.slip
RUN rm radserver.zip
RUN rm InterBase_2017_EN.zip
RUN rm PAServer-20.0 -r
RUN rm paserver.tar.gz
RUN rm radserver_install.sh
RUN rm /opt/interbase -r
RUN rm /usr/interbase
RUN ​echo​ ​"#!/bin/bash"​ > ./cleaninstnacename.sh
RUN ​echo​ ​"sed -i
':a;N;\$!ba;s#InstanceName=localhost/3050\\\n#InstanceName=\\\n#g'
/etc/ems/emsserver.ini"​ >> ./cleaninstnacename.sh
RUN sh ./cleaninstnacename.sh
RUN rm ./cleaninstnacename.sh
#======END CLEAN UP=====
RUN service apache2 restart
EXPOSE ​80
EXPOSE ​64211
EXPOSE ​8082
#need this to make the apache daemon run in foreground
#prevent container from ending when docker is started
RUN chmod +x ./radserver_docker.sh
CMD ./radserver_docker.sh

 
38  

The Dockerfile relies on the paserver_docker.sh script which is contained below. The 
paserver_docker.sh script is executed at runtime when the Docker instance is run. As 
can be seen in the script the broadwayd server, paserver, and Apache are started. The 
script watches the paserver and Apache processes to make sure they are still running. 
Once the paserver and Apache processes terminate the Docker instance will also end.  

Runtime Script (radserver_docker.sh) 


#!/bin/bash

if​ [ " ​ ​$CONFIG​"​ = ​"PRODUCTION"​ ]; ​then


:
else
nohup broadwayd :2 &
​export​ GDK_BACKEND=broadway
​export​ BROADWAY_DISPLAY=:2
fi
#search and replace ems ini file InstanceName
if​ [ ​"​$DB_HOST​"​ = ​""​ ]; ​then
:
else
sed -i
':a;N;$!ba;s#InstanceName=[^\n]*#InstanceName='"​${DB_HOST}​/​${DB_PORT}​"'#
g'​ /etc/ems/emsserver.ini
fi
/usr/sbin/apachectl -D Foreground
status=$?
if​ [ ​$status​ -ne 0 ]; ​then
​echo​ ​"Failed to start apache: ​$status​"
​exit​ ​$status
fi
if​ [ ​"​$CONFIG​"​ = ​"PRODUCTION"​ ]; ​then
:
else
./paserver -password=​$PA_SERVER_PASSWORD
status=$?
​if​ [ ​$status​ -ne 0 ]; ​then
​echo​ ​"Failed to start paserver: ​$status​"
​exit​ ​$status
​fi
fi

 
39  

while​ sleep 60; ​do


ps aux |grep paserver |grep -q -v grep
PA_SERVER_STATUS=$?
ps aux |grep apache |grep -q -v grep
APACHE_STATUS=$?
​if​ [ ​$PA_SERVER_STATUS​ -eq 0 -a ​$APACHE_STATUS​ -eq 0 ]; ​then
​echo​ ​"Complete!"
​exit​ 1
​fi
done

A. Sample Build And Run Commands 


The Dockerfile build and run commands listed below can be used to create an image 
that has RAD Server and PAServer installed along with the required libraries to use the 
GTK broadwayd display server. T
​ he hostname address and port for the RAD Server 
database (InterBase) can be either specified during build time or during run time. 
Persistent changes to RAD Server on the Docker container image instance 
require the persistent volume functionality can be used by using the --mount 
parameter. 

# standard build with the build args for the PAServer password,
InterBase hostname, and InterBase port
docker build . -t pa-radserver --no-cache --build-arg
password=[PASERVER PASSWORD] --build-arg dbhost=[INTERBASE HOST]
--build-arg dbport=[INTERBASE PORT]

# run detached in the background passing in PAServer password,


InterBase Hostname, and InterBase port
docker run -d -e DB_PORT=[INTERBASE PORT] -e DB_HOST=[INTERBASE HOST]
-e PA_SERVER_PASSWORD=[PASSWORD] -p [EXTERNAL HTTP PORT]:80 -p
[EXTERNAL BROADWAYD PORT]:8082 -p [EXTERNAL PA SERVER PORT]:64211
radstudio/pa-radserver

# run detached in the background using a default PAServer password


and passing in a InterBase Hostname and InterBase port
docker run -d -e DB_PORT=[INTERBASE PORT] -e DB_HOST=[INTERBASE HOST]

 
40  

-p [EXTERNAL HTTP PORT]:80 -p [EXTERNAL BROADWAYD PORT]:8082 -p


[EXTERNAL PA SERVER PORT]:64211 radstudio/pa-radserver

# run Dockerfile built image detached in the background passing in


PAServer password, InterBase Hostname, and InterBase port
docker run -d -e PA_SERVER_PASSWORD=[PASSWORD] -e DB_PORT=[INTERBASE
PORT] -e DB_HOST=[INTERBASE HOST] -p [EXTERNAL BROADWAYD PORT]:8082
-p [EXTERNAL HTTP PORT]:80 -p [EXTERNAL PA SERVER PORT]:64211
pa-radserver

# run Dockerfile built image detached in the background using the


default PAServer password and passing in an InterBase Hostname and
InterBase port
docker run -d -e DB_PORT=[INTERBASE PORT] -e DB_HOST=[INTERBASE HOST]
-p [EXTERNAL BROADWAYD PORT]:8082 -p [EXTERNAL HTTP PORT]:80 -p
[EXTERNAL PA SERVER PORT]:64211 pa-radserver

# run DockerHub image in the foreground passing in PAServer password,


InterBase Hostname, and InterBase port
docker run -it -e DB_PORT=[INTERBASE PORT] -e DB_HOST=[INTERBASE
HOST] -e PA_SERVER_PASSWORD=[PASSWORD] -p [EXTERNAL HTTP PORT]:80 -p
[EXTERNAL PA SERVER PORT]:64211 -p [EXTERNAL BROADWAYD PORT]:8082
radstudio/pa-radserver

# run DockerHub image in the foreground using a default PAServer


password and passing in the InterBase Hostname and InterBase port
docker run -it -e DB_PORT=[INTERBASE PORT] -e DB_HOST=[INTERBASE
HOST] -p [EXTERNAL HTTP PORT]:80 -p [EXTERNAL PA SERVER PORT]:64211
-p [EXTERNAL BROADWAYD PORT]:8082 radstudio/pa-radserver

# run Dockerfile built image in the foreground passing in PAServer


password, InterBase Hostname, and InterBase port
docker run -it -e DB_PORT=[INTERBASE PORT] -e DB_HOST=[INTERBASE
HOST] -e PA_SERVER_PASSWORD=[PASSWORD] -p [EXTERNAL HTTP PORT]:80 -p
[EXTERNAL PA SERVER PORT]:64211 -p [EXTERNAL BROADWAYD PORT]:8082
pa-radserver

# run Dockerfile built image in the foreground using the default


PAServer password and passing in an InterBase Hostname and InterBase
port

 
41  

docker run -it -e DB_PORT=[INTERBASE PORT] -e DB_HOST=[INTERBASE


HOST] -p [EXTERNAL HTTP PORT]:80 -p [EXTERNAL PA SERVER PORT]:64211
-p [EXTERNAL BROADWAYD PORT]:8082 pa-radserver

# run DockerHub image detached in the background passing in PAServer


password, InterBase Hostname, and InterBase port and defining a
persistent volume on /etc/ems
docker run -d --mount ​source​=[VOLUME],target=/etc/ems -e
DB_PORT=[INTERBASE PORT] -e DB_HOST=[INTERBASE HOST] -e
PA_SERVER_PASSWORD=[PASSWORD] -p [EXTERNAL HTTP PORT]:80 -p [EXTERNAL
PA SERVER PORT]:64211 -p [EXTERNAL BROADWAYD PORT]:8082
radstudio/pa-radserver

# run DockerHub image detached in the background using the default


PAServer password, passing in the InterBase Hostname and InterBase
port, and defining a persistent volume on /etc/ems
docker run -d --mount ​source​=[VOLUME],target=/etc/ems -e
DB_PORT=[INTERBASE PORT] -e DB_HOST=[INTERBASE HOST] -p [EXTERNAL
HTTP PORT]:80 -p [EXTERNAL PA SERVER PORT]:64211 -p [EXTERNAL
BROADWAYD PORT]:8082 radstudio/pa-radserver

# run Dockerfile built image detached in the background passing in


PAServer password, InterBase Hostname, InterBase port, and defining a
persistent volume on /etc/ems
docker run -d --mount ​source​=[VOLUME],target=/etc/ems -e
DB_PORT=[INTERBASE PORT] -e DB_HOST=[INTERBASE HOST] -e
PA_SERVER_PASSWORD=[PASSWORD] -p [EXTERNAL HTTP PORT]:80 -p [EXTERNAL
PA SERVER PORT]:64211 -p [EXTERNAL BROADWAYD PORT]:8082 pa-radserver

# run Dockerfile built image detached in the background using the


default PAServer password, passing in the InterBase Hostname,
InterBase port, and defining a persistent volume on /etc/ems
docker run -d --mount ​source​=[VOLUME],target=/etc/ems -e
DB_PORT=[INTERBASE PORT] -e DB_HOST=[INTERBASE HOST] -p [EXTERNAL
HTTP PORT]:80 -p [EXTERNAL PA SERVER PORT]:64211 -p [EXTERNAL
BROADWAYD PORT]:8082 pa-radserver

 
B. pa-radserver Example Child Image 
 
42  

This will create a new image with the InterBase host and port configured during build 
time using the pa-radserver image as a base.The run example shown has a persistent 
volume so changes to /etc/ems will stay over multiple docker runs.  
Dockerfile 
FROM radstudio/pa-radserver

ARG dbhost
ARG dbport
ARG password=embtdocker

ENV PA_SERVER_PASSWORD=$password
ENV DB_HOST=$dbhost
ENV DB_PORT=$dbport

RUN service apache2 restart

Build Command Lines 


# child build tagged as pa-radserver-child passing in the InterBase
hostname and port
docker build --tag=pa-radserver-child . --build-arg dbhost=[INTERBASE
HOST] --build-arg dbport=[INTERBASE PORT]

# run Dockerfile built pa-radserver-child image passing in a PAServer


password and defining a persistent volume on /etc/ems
docker run -it ​--mount ​source​=[VOLUME],target=/etc/ems​ -e
PA_SERVER_PASSWORD=​[PASSWORD]​ -p ​[EXTERNAL HTTP PORT]​:80 -p ​[EXTERNAL
PA SERVER PORT]​:64211 -p ​[EXTERNAL BROADWAYD PORT]​:8082
pa-radserver-child 

   

 
43  

C. pa-radserver Custom RAD Server Module 


This will create an image with a module in the /etc/ems directory and the 
/ems/emsserver.ini file correctly populated to use said module. The run example shown 
has a persistent volume so changes to /etc/ems will stay over multiple docker runs. 

Dockerfile 
FROM radstudio/pa-radserver

ARG password=embtdocker
ARG ModuleName=module
ARG ModuleFile
ARG dbhost
ARG dbport
ENV PA_SERVER_PASSWORD=$password
ENV DB_HOST=$dbhost
ENV DB_PORT=$dbport

COPY ​$ModuleFile​ /etc/ems/​$ModuleFile

RUN ​echo​ ​"#!/bin/bash"​ > ./emsscript.sh

#populate emsserver.ini with module data


ARG FindValue=:a;N;\$!ba;s​#\\\[Server\\\.Packages\\\]
ARG ReplaceValue=​#\\\[Server\\\.Packages\\\]
ARG ForwardSlash=/
ARG PoundG=​#g
ARG EmsIni=/etc/ems/emsserver.ini
RUN ​echo​ -n ​"sed -i '"​ >> ./emsscript.sh
RUN ​echo​ -n ​"​$FindValue​"​ >> ./emsscript.sh
RUN ​echo​ -n ​"\\"​ >> ./emsscript.sh
RUN ​echo​ -n ​"n"​ >> ./emsscript.sh
RUN ​echo​ -n ​"​$ReplaceValue​"​ >> ./emsscript.sh
RUN ​echo​ -n ​"\\"​ >> ./emsscript.sh
RUN ​echo​ -n ​"n"​ >> ./emsscript.sh
RUN ​echo​ -n ​"/etc/ems/​$ModuleFile​=​$ModuleName​"​ >> ./emsscript.sh
RUN ​echo​ -n ​"​$PoundG​' "​ >> ./emsscript.sh
RUN ​echo​ -n ​"​$EmsIni​"​ >> ./emsscript.sh
RUN ​echo​ ​""​ >> ./emsscript.sh
RUN sh ./emsscript.sh

   

 
44  

Build Command Lines 


# child build tagged as pa-radserver-custom-module passing in the
InterBase hostname, port, and RAD Server endpoint custom resource
module filename
docker build --tag=pa-radserver-custom-module . --build-​arg
dbhost=[INTERBASE HOST] --build-​arg​ dbport=[INTERBASE PORT] --build-​arg
ModuleFile=[MODULE FILE]

# run Dockerfile built pa-radserver-custom-module image passing in a


PAServer password and defining a persistent volume on /etc/ems
docker ​run​ -it ​--mount ​source​=[VOLUME],target=/etc/ems​ -e
PA_SERVER_PASSWORD=​[PASSWORD]​ -p ​[EXTERNAL HTTP PORT]​:80 -p ​[EXTERNAL
PA SERVER PORT]​:64211 -p ​[EXTERNAL BROADWAYD PORT]​:8082
pa-radserver-custom-module

   

 
45  

III. RADServer + PAServer + InterBase Dockerfile 


The RADServer + PAServer + InterBase (​pa-radserver-ib​) Dockerfile is contained below 
and includes the instructions which are used at build time by Docker to create the Docker 
image. The Dockerfile relies on a specific version of the RAD Server production installer 
and PAServer that are downloaded from Embarcadero at build time. It can be updated to 
support future releases by updating the URLs of the RAD Server production installer and 
the PAServer archive. The default password for paserver is set to ‘embtdocker’ as can be 
seen defined below. 

https://github.com/Embarcadero/pa-radserver-ib-docker 

Dockerfile 
FROM ubuntu:bionic

ARG password=embtdocker
ENV PA_SERVER_PASSWORD=$password
COPY radserver_docker.sh ./radserver_docker.sh
RUN ​echo​ ​"gds-db 3050/tcp gds_db # InterBase server"​ >>
/etc/services
RUN ​echo​ ​"gds-db 3050/udp gds_db"​ >> /etc/services
RUN ​echo​ ​"gds_db 3050/tcp #InterBase Server"​ >> /etc/services
#INSTALL APACHE AND OTHER LIBS
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -yy
install --no-install-recommends \
apache2 \
unzip \
xorg libgl1-mesa-dev libosmesa-dev libgtk-3-bin build-essential
\
libcurl3 libcurl-openssl1.0-dev \
&& apt-get -y autoremove \
&& apt-get -y autoclean
#====END OTHER LIBS
#====GET ZIP FILES====
ADD
http://altd.embarcadero.com/getit/public/libraries/RADServer/RADServ
erInstallerLinux_1032.zip ./radserver.zip
ADD

 
46  

http://altd.embarcadero.com/releases/studio/20.0/PAServer/Release2/L
inuxPAServer20.0.tar.gz ./paserver.tar.gz
RUN unzip radserver.zip
RUN tar xvzf paserver.tar.gz
#========END ZIP FILES
RUN touch ./radserverlicense.slip
#Comment out the previous line and un-comment the next two to use a
slip file
#COPY radserverlicense.slip ./radserverlicense.slip
#RUN chmod 644 ./radserverlicense.slip
RUN sh ./radserver_install.sh -silent
RUN mv PAServer-20.0/* .
RUN ​echo​ ​"LoadModule emsserver_module
/usr/lib/ems/libmod_emsserver.so"​ >
/etc/apache2/mods-available/radserver.load
RUN ​echo​ ​"<Location /radserver>"​ >
/etc/apache2/mods-available/radserver.conf
RUN ​echo​ ​" SetHandler libmod_emsserver-handler"​ >>
/etc/apache2/mods-available/radserver.conf
RUN ​echo​ ​"</Location>"​ >> /etc/apache2/mods-available/radserver.conf
RUN a2enmod radserver
RUN ​echo​ ​"LoadModule emsconsole_module
/usr/lib/ems/libmod_emsconsole.so"​ >
/etc/apache2/mods-available/radserverconsole.load
RUN ​echo​ ​"<Location /radconsole>"​ >
/etc/apache2/mods-available/radserverconsole.conf
RUN ​echo​ ​" SetHandler libmod_emsconsole-handler"​ >>
/etc/apache2/mods-available/radserverconsole.conf
RUN ​echo​ ​"</Location>"​ >>
/etc/apache2/mods-available/radserverconsole.conf
RUN a2enmod radserverconsole
#=====CLEAN UP==========
RUN rm RADServer.bin
RUN rm radserverlicense.slip
RUN rm radserver.zip
RUN rm InterBase_2017_EN.zip
RUN rm PAServer-20.0 -r
RUN rm paserver.tar.gz
RUN rm radserver_install.sh

 
47  

RUN sed -e ​'/apachesetup.sh/ { d; }'​ /tmp/linux_cleanup.sh -i


RUN sed -e ​'/rssetup.sh/ { d; }'​ /tmp/linux_cleanup.sh -i
RUN sh /tmp/linux_cleanup.sh
#======END CLEAN UP=====
RUN service apache2 restart
EXPOSE ​80
EXPOSE ​64211
EXPOSE ​8082
EXPOSE ​3050
#need this to make the apache daemon run in foreground
#prevent container from ending when docker is started
RUN chmod +x ./radserver_docker.sh
CMD ./radserver_docker.sh

   

 
48  

The Dockerfile relies on the paserver_docker.sh script which is contained below. The 
paserver_docker.sh script is executed at runtime when the Docker instance is run. As 
can be seen in the script the broadwayd server, paserver, Apache, and the RAD Server 
database (InterBase) are started. The script watches the paserver, Apache, and 
InterBase processes to make sure they are still running. Once the paserver, Apache, and 
InterBase processes terminate the Docker instance will also end.  

Runtime Script 
#!/bin/bash

if​ [ -f /etc/ems/emsserver.ini -a -f /etc/ems/emsserver.ib ]; ​then


:
else
rm /opt/interbase/license/radserverlicense.slip

/opt/interbase/bin/LicenseManagerLauncher -i console

sh /tmp/rssetup.sh swaggerui RS,RC,SUI


sh /tmp/apachesetup.sh radserver radconsole RS,RC
fi
if​ [ -f /etc/ems/module.so ]; ​then
sed -i
':a;N;$!ba;s#\[Server\.Packages\]\n#\[Server\.Packages\]\n/etc/ems/m
odule.so=module#g'​ /etc/ems/emsserver.ini
fi
if​ [ ​"​$CONFIG​"​ = ​"PRODUCTION"​ ]; ​then
:
else
​if​ [ ​"​$CONFIG​"​ = ​"INTERBASE"​ ]; ​then
:
​else
nohup broadwayd :2 &
​export​ GDK_BACKEND=broadway
​export​ BROADWAY_DISPLAY=:2
​fi
fi
if​ [ ​"​$CONFIG​"​ = ​"INTERBASE"​ ]; ​then
service apache2 stop

 
49  

else
/usr/sbin/apachectl -D Foreground
status=$?
​if​ [ ​$status​ -ne 0 ]; ​then
​echo​ ​"Failed to start apache: ​$status​"
​exit​ ​$status
​fi
fi
/opt/interbase/bin/ibmgr -start -forever
status=$?
if​ [ ​$status​ -ne 0 ]; ​then
​echo​ ​"Failed to start interbase: ​$status​"
​exit​ ​$status
fi
if​ [ ​"​$CONFIG​"​ = ​"PRODUCTION"​ ]; ​then
:
else
​if​ [ ​"​$CONFIG​"​ = ​"INTERBASE"​ ]; ​then
:
​else
./paserver -password=​$PA_SERVER_PASSWORD
status=$?
​if​ [ ​$status​ -ne 0 ]; ​then
​echo​ ​"Failed to start paserver: ​$status​"
​exit​ ​$status
​fi
​fi
fi
while​ sleep 60; ​do
ps aux |grep paserver |grep -q -v grep
PA_SERVER_STATUS=$?
​if​ [ ​"​$CONFIG​"​ = ​"PRODUCTION"​ ]; ​then
PA_SERVER_STATUS=0
​else
​if​ [ ​"​$CONFIG​"​ = ​"INTERBASE"​ ]; ​then
PA_SERVER_STATUS=0
​fi
​fi
​if​ pgrep -x ​"ibserver"​ >/dev/null
​then

 
50  

INTERBASE_STATUS=1
​else
INTERBASE_STATUS=0
​fi
ps aux |grep apache |grep -q -v grep
APACHE_STATUS=$?
​if​ [ ​"​$CONFIG​"​ = ​"INTERBASE"​ ]; t
​ hen
APACHE_STATUS=0
​fi
​if​ [ ​$PA_SERVER_STATUS​ -eq 0 -a $ ​ APACHE_STATUS​ -eq 0 -a
$INTERBASE_STATUS​ -eq 0 ]; ​then
​echo​ ​"Complete!"
​exit​ 1
​fi
done

A. Licensing 
This Dockerfile will create an image that contains a ready-to-be-licensed install of 
InterBase, RADServer and PAServer. In order to license the InterBase install the user 
must run it in foreground mode on the first run using the -
​ it​ parameter. All runs after 
the initial run can be in the background by using -
​ d​ instead. This Dockerfile also has the 
capability of creating a licensed install of InterBase, RADServer, and PAServer with a 
distribution license slip file. To build a licensed image simply comment out RUN touch 
./radserverlicense.slip and uncomment the following lines. The file should go from this  

RUN​ touch ./radserverlicense.slip


#Comment out the previous line and un-comment the next two to use a
slip file
#COPY radserverlicense.slip ./radserverlicense.slip
#RUN chmod 644 ./radserverlicense.slip 

to this 

#RUN touch ./radserverlicense.slip


#Comment out the previous line and un-comment the next two to use a
slip file
COPY​ radserverlicense.slip ./radserverlicense.slip

 
51  

RUN ​chmod 644 ./radserverlicense.slip 

The radserverlicense.slip file should be in the same directory as the Dockerfile when the 
Docker container image is built. 

B. Sample Build Scripts 


The Dockerfile build commands listed below can be used to create an image that has 
PAServer, RAD Server on Apache, and the RAD Server database (InterBase) installed 
along with the required libraries to use the GTK broadwayd display server. 

Build Command Lines 


# standard build
docker build --tag=pa-radserver-ib .

# standard build with the build arg for the PAServer password
docker build --tag=pa-radserver-ib . --build-arg password=[PASERVER
PASSWORD]

# run DockerHub image detached in the background passing in a


PAServer password, defining a persistent volume on /etc/ems, and
defining a persistent volume on /opt/interbase
docker run -d -e PA_SERVER_PASSWORD=[PASSWORD] -p [EXTERNAL HTTP
PORT]:80 -p [EXTERNAL PA SERVER PORT]:64211 -p [EXTERNAL BROADWAYD
PORT]:8082 -p [EXTERNAL INTERBASE PORT]:3050 --mount
source​=[INTERBASE VOLUME NAME],target=/opt/interbase --mount
source​=[EMS VOLUME NAME],target=/etc/ems radstudio/pa-radserver-ib

# run Dockerfile built image detached in the background passing in a


PAServer password, defining a persistent volume on /etc/ems, and
defining a persistent volume on /opt/interbase
docker run -d -e PA_SERVER_PASSWORD=[PASSWORD] -p [EXTERNAL HTTP
PORT]:80 -p [EXTERNAL PA SERVER PORT]:64211 -p [EXTERNAL BROADWAYD
PORT]:8082 -p [EXTERNAL INTERBASE PORT]:3050 --mount
source​=[INTERBASE VOLUME NAME],target=/opt/interbase --mount
source​=[EMS VOLUME NAME],target=/etc/ems pa-radserver-ib

# run DockerHub image detached in the background in production mode


(PAServer and broadwayd disable), defining a persistent volume on

 
52  

/etc/ems, and defining a persistent volume on /opt/interbase


docker run -d -e CONFIG=PRODUCTION -p [EXTERNAL HTTP PORT]:80 -p
[EXTERNAL INTERBASE PORT]:3050 --mount ​source​=[INTERBASE VOLUME
NAME],target=/opt/interbase --mount ​source​=[EMS VOLUME
NAME],target=/etc/ems radstudio/pa-radserver-ib

# run Dockerfile built image detached in the background in


production mode (PAServer and broadwayd disable), defining a
persistent volume on /etc/ems, and defining a persistent volume on
/opt/interbase
docker run -d -e PA_SERVER_PASSWORD=[PASSWORD] -e CONFIG=PRODUCTION
-p [EXTERNAL HTTP PORT]:80 -p [EXTERNAL INTERBASE PORT]:3050 --mount
source​=[INTERBASE VOLUME NAME],target=/opt/interbase --mount
source​=[EMS VOLUME NAME],target=/etc/ems pa-radserver-ib

# run DockerHub image in the foreground passing in PAServer


password, defining a persistent volume on /etc/ems, and defining a
persistent volume on /opt/interbase
docker run -it -e PA_SERVER_PASSWORD=[PASSWORD] -p [EXTERNAL HTTP
PORT]:80 -p [EXTERNAL PA SERVER PORT]:64211 -p [EXTERNAL BROADWAYD
PORT]:8082 -p [EXTERNAL INTERBASE PORT]:3050 --mount
source​=[INTERBASE VOLUME NAME],target=/opt/interbase --mount
source​=[EMS VOLUME NAME],target=/etc/ems radstudio/pa-radserver-ib

# run Dockerfile built image in the foreground passing in PAServer


password, defining a persistent volume on /etc/ems, and defining a
persistent volume on /opt/interbase
docker run -it -e PA_SERVER_PASSWORD=[PASSWORD] -p [EXTERNAL HTTP
PORT]:80 -p [EXTERNAL PA SERVER PORT]:64211 -p [EXTERNAL BROADWAYD
PORT]:8082 -p [EXTERNAL INTERBASE PORT]:3050 --mount
source​=[INTERBASE VOLUME NAME],target=/opt/interbase --mount
source​=[EMS VOLUME NAME],target=/etc/ems pa-radserver-ib

# run DockerHub image in the foreground in production mode (PAServer


and broadwayd disable), defining a persistent volume on /etc/ems,
and defining a persistent volume on /opt/interbase
docker run -it -e CONFIG=PRODUCTION -p [EXTERNAL HTTP PORT]:80 -p
[EXTERNAL INTERBASE PORT]:3050 --mount ​source​=[INTERBASE VOLUME
NAME],target=/opt/interbase --mount ​source​=[EMS VOLUME
NAME],target=/etc/ems radstudio/pa-radserver-ib

 
53  

# run Dockerfile built image in the foreground in production mode


(PAServer and broadwayd disable), defining a persistent volume on
/etc/ems, and defining a persistent volume on /opt/interbase
docker run -it -e CONFIG=PRODUCTION -p [EXTERNAL HTTP PORT]:80 -p
[EXTERNAL INTERBASE PORT]:3050 --mount ​source​=[INTERBASE VOLUME
NAME],target=/opt/interbase --mount ​source​=[EMS VOLUME
NAME],target=/etc/ems pa-radserver-ib 

C. pa-radserver-ib Example Child Image 


This will create a new image that has the PAServer password configured at build time 
and installs a the nano text editor package as an example. The run example shown has a 
persistent volume so changes to /etc/ems and /opt/interbase will stay over multiple 
docker runs. 

Dockerfile 
FROM​ radstudio/pa-radserver-ib

ARG​ password=embtdocker
ENV​ PA_SERVER_PASSWORD=$password
RUN​ apt-get update && apt-get install nano

Build Command Scripts 


# standard build with a tag of pa-radserver-ib-child and a build arg of
password
docker build --tag=pa-radserver-ib-child . --build-arg
password=[PASERVER PASSWORD]

# run pa-radserver-ib-child image in the foreground i​n production mode


(PAServer and broadwayd disable) defining a persistent volume on
/etc/ems, and defining a persistent volume on /opt/interbase
docker run -it ​--mount ​source​=[EMS VOLUME],target=/etc/ems --mount
source​=[IB VOLUME],target=/opt/interbase​ ​-e CONFIG=PRODUCTION ​-p
80:80 -p 64211:64211 -p 8082:8082 pa-radserver-ib-child 

 
54  

D. pa-radserver-ib Custom RAD Server Module 


This will create a new image that has the PAServer password configured at build time. 
This will also put the module file specified in the /etc/ems directory as module.so. If this 
example is used, it is important that the module file exists in the same directory as the 
Dockerfile. The run example shown has a persistent volume so changes to /etc/ems and 
/opt/interbase should last between multiple Docker runs. 

Dockerfile 
FROM radstudio/pa-radserver-ib

ARG password=embtdocker
ARG modulefile
ENV PA_SERVER_PASSWORD=$password

COPY ​$modulefile​ /etc/ems/module.so

Build Command Lines 


# standard build with a tag of pa-radserver-ib-custom-module, a PAServer
password, and a build arg to define a RAD Server endpoint custom
resource module filename
docker build --tag=pa-radserver-ib-custom-module . --build-arg
password=[PASERVER PASSWORD] --build-arg modulefile=[MODULE FILE NAME]

# run pa-radserver-ib-custom-module image in the foreground in


production mode (PAServer and broadwayd disable) defining a persistent
volume on /etc/ems, and defining a persistent volume on /opt/interbase
docker run -it ​--mount ​source​=[EMS VOLUME],target=/etc/ems --mount
source​=[IB VOLUME],target=/opt/interbase​ ​-e CONFIG=PRODUCTION ​-p
80:80 -p 64211:64211 -p 8082:8082 pa-radserver-ib-custom-module 

You might also like