Professional Documents
Culture Documents
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
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!
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/
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.
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.
9
APT simply run the apt install command with elevated privileges either by using sudo or by
using the super user account.
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.
Example Run:
docker pull 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.
unzip RADServerInstallerLinux_1032.zip
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.
13
-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.
Example Run:
docker pull 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
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.
17
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.
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.
-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 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
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
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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
27
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.
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.
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.
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
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.
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.
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.
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.
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
31
6. Build the image.
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.
33
done
34
# standard build
docker build .
# standard build with the build arg for the PAServer password
docker build . --build-arg password=securepass
35
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
37
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.
39
# 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]
40
41
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
43
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
44
45
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
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
/opt/interbase/bin/LicenseManagerLauncher -i console
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
to this
51
The radserverlicense.slip file should be in the same directory as the Dockerfile when the
Docker container image is built.
# standard build with the build arg for the PAServer password
docker build --tag=pa-radserver-ib . --build-arg password=[PASERVER
PASSWORD]
52
53
Dockerfile
FROM radstudio/pa-radserver-ib
ARG password=embtdocker
ENV PA_SERVER_PASSWORD=$password
RUN apt-get update && apt-get install nano
54
Dockerfile
FROM radstudio/pa-radserver-ib
ARG password=embtdocker
ARG modulefile
ENV PA_SERVER_PASSWORD=$password