Delphi and Linux Docker Support
Over the last few years, it has become more and more common to deploy server side solutions (and in fact any type of application) to lightweight containers rather than physical machines or virtual machines, as this allows more flexibility (also in terms of testing), a better way to rebuild the same execution environment, and more scalability. Along with the 10.3.3 release, Embarcadero has started officially supporting deployment of general Linux applications to Docker containers, specifically supporting the deployment to RAD Server.
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.
What is Docker Hub?
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.
RAD Studio Linux Docker Containers
The RAD Studio Docker containers paserver, pa-radserver, and pa-radserver-ib are available directly from DockerHub and also as Dockerfiles (on GitHub) 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 radstudio/paserver, radstudio/pa-radserver, and radstudio/pa-radserver-ib. For this blog post I’ll start focusing on the first one, radstudio/paserver, which does not include RAD Server.
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 in the scripts we provide, including for example the password for PAServer.
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 (they are transient images). 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.