Building a Docker Image

#### Search Results

Search

# Building a Docker Image

The docker image can be configured for the supported web servers.

There are a number of supported Servlet containers.

Wildfly® | A Dockerfile that uses a standard Wildfly 29 image with Java17 is provided.
Tomcat® | A Dockerfile using a Tomcat 10 image with Java17 is provided.
Embedded | A Tomcat 10 embeded in the delivered war base image using Java17.

To Create the Docker Image

1. #### Build the Image

   The script createDockerImage.sh can be used to package the Natural Availability Server into an image.

   Use the following command to create the image:

       ./createDockerImage [options]

   The following options can be called:

         --appserver    Name of the application server to use ("wildfly"|"tomcat"|"embedded“) (default "embedded")
         --help         Help for this script

2. #### Run the Image

   The script createDockerImage.sh automatically creates a suitable docker run command. After generating an image successfully, the docker run command will appear at the end of the build's docker log.

   To run the newly created Natural Availability Server as a container, a valid Natural Availability Server license is needed. The generated command will expect the file to be present in the directory /licenses.

   Example for version 9.3.1

       podman run -dt -p 8080:8080 -v ./licenses/nha93.xml:/opt/softwareag/common/conf/nha93.xml:z \
         -v ./embedded/application.properties:/opt/softwareag/NaturalAvailabilityServer/conf/application.properties natural_availability_server:9.3.1

3. #### Run the Web Application

   Open a browser on the local machine and navigate to the URL http://localhost:8080/.

4. #### SSL

   For use with SSL encryption, the configuration files have to be adjusted according to the manuals at https://docs.wildfly.org/ or https://tomcat.apache.org/.