Build and deploy Docker image
Once you have created a new application, there is an option to package it into a Docker container and launch it or deliver it to a registry.
To do this, the following steps are required:
Windows:
Prerequisites:
Windows 10, version 2004 and higher (build 19041 and higher), or Windows 11.
Docker for Windows is problematic to use from the command line and Docker's native Linux application cannot be used under WSL.
Therefore, we recommend using Podman on Windows.
Either install the native Linux app on an Ubuntu/Debian WSL or follow the official instructions for Windows, see the next section.
Linux|MacOS|Windows(WSL):
Prerequisites:
Please refer to the table listed at this link for the prerequisites for Docker on Linux:
https://docs.docker.com/engine/install/#server
Install Docker or Podman:
Notice:
Docker on Linux requires either prepending the command sudo
or to belong to the group docker
.
To use Docker without sudo run the following commands and then reboot the PC (or WSL):
sudo groupadd docker
sudo usermod -aG docker $USER
Build Container:
After the Create New TopLogic App step, you will find a subdirectorysrc/main/docker
with three files in the project folder of the new app:
- createDocker.sh
- Script for building a container, help with parameter -h
- BuildParameters
- Contains parameters for the container such as startup options and database settings. For detailed descriptions of the parameters, please refer to the file itself.
- Dockerfile_template
- Template for the Docker configuration file. Required by the script, can also be customized. See: Dockerfile reference
Make the script executable with chmod +x createDocker.sh
.
Without further customization, the script can be executed with ./createDocker.sh
.
The build WAR step is executed first, then a Docker container with the name "toplogic" is built and started locally.
The log output of the web server is displayed in the console, a web browser with the new app opens automatically.
If the console is closed or the process is interrupted with ctrl + c, the app is terminated again. The following command restarts the app:
docker start toplogic
podman start toplogic