Configuring application containers
When you run the analyze command, an
analysis.json
file is created for the application that is
specified in the --application-id
parameter. The
containerize command uses this file to build the application
container image and to generate artifacts.
You can configure the fields in the containerParameters
section
before running the containerize command to customize your
application container. For configurable key/value pairs that do not apply to
your container, set string values to an empty string, numeric values to zero,
and Boolean values to false.
For applications running on Linux, the application analysis.json
file includes the following content:
Read-only data
-
Control fields – Fields having to do with file creation, such as template version, and the file creation timestamp.
-
analysisInfo – System dependencies for the application.
Configurable data
The containerParameters
section contains the following fields:
-
imageRepository (string, required) – The name of the repository where the application container image is stored.
-
imageTag (string, required) – A tag for the build version of the application container image.
-
containerBaseImage (string) – The base operating system (OS) image for the container build. By default, App2Container uses the operating system from the application server or worker machine where containerization runs.
Note
If specified, this must be an image name from your registry in the format <image name>[:<tag>], and it must match the operating system platform and version that runs on the application server or worker machine where containerization runs. The tag is optional if the repository supports "latest".
-
appExcludedFiles (array of strings) – Specific files and directories to exclude from the container build.
-
appSpecificFiles (array of strings) – Specific files and directories to include in the container build.
-
applicationPort (number) – The application port exposed inside of the container. This port is tested for a successful HTTP response during pre-validation when the containerize command runs. App2Container assigns this as the default exposed port when creating a load balancer during deployment.
-
applicationMode (Boolean, required) – The approach that App2Container uses to determine which files to include in your container image. App2Container uses application mode (value=true) for supported application frameworks, and process mode (value=false) for all other configurations.
You can override this value if necessary. For example, if your application is running on a supported framework, but App2Container did not recognize it and therefore assigned process mode, you can override the setting to use application mode instead.
Application mode settings
-
true
(application mode): For supported application frameworks, App2Container targets only the application files and dependencies that are needed for containerization, thereby minimizing the size of the resulting container image. This is known as application mode. Supported application frameworks include: Tomcat, TomEE, and JBoss (standalone mode). -
false
(process mode): If App2Container does not find a supported framework running on your application server, or if you have other dependent processes running on your server, App2Container takes a conservative approach to identifying dependencies. This is known as process mode. For process mode, all non-system files on the application server are included in the container image.
Tip
If your application container image includes unnecessary files, or is missing files that should be included, use the following parameters to make corrections:
-
To specify files to exclude from your application container image, use the
appExcludedFiles
parameter. -
To add files that were missed, use the
appSpecificFiles
parameter.
-
-
logLocations (array of strings) – Specific log files or log directories to be routed to
stdout
. This enables applications that write to log files on the host to be integrated with AWS services such as CloudWatch and Firehose. -
enableDynamicLogging (Boolean, required) – Maps application logs to
stdout
as they are created. If set to true, requires log directories to be entered inlogLocations
. -
dependencies (array of strings) – A listing of all dependent processes or applications found for the application ID by the analyze command. You can remove specific dependencies to exclude them from the container.
Examples
The following examples show an analysis.json
file for an
application running on Linux. Choose the tab that matches your application.
For applications running on Windows, the application analysis.json
file includes the following content:
Read-only data
-
Control fields – Fields having to do with file creation, such as template version, and the file creation timestamp.
-
analysisInfo – System dependencies for the application.
Configurable data
The containerParameters
section contains the following fields:
-
containerBaseImage (string) – The base operating system (OS) image for the container build. By default, App2Container uses the operating system from the application server or worker machine where containerization runs.
Note
If specified, this must be an image name from your registry in the format <image name>[:<tag>], and it must match the operating system platform and version that runs on the application server or worker machine where containerization runs. The tag is optional if the repository supports "latest".
-
enableServerConfigurationUpdates (Boolean, required) – Provides an option in the Dockerfile to restore the application configuration of the source server.
-
imageRepositoryName (string, required) – The name of the repository where the application container image is stored.
-
imageTag (string, required) – A tag for the build version of the application container image.
-
additionalExposedPorts (array of numbers) – Additional port numbers that should be exposed inside of the application container.
-
appIncludedFiles (array of strings) – Specific files and directories to include in the container build.
-
appExcludedFiles (array of strings) – Specific files and directories to exclude from the container build.
-
enableLogging (Boolean, required) – Enables dynamic logging, redirecting application logs to container
stdout
. -
includedWebApps (array of strings) – The application IDs for web applications running under the IIS site that should be included in the container image. Applications must have been running in IIS during inventory and analysis.
-
additionalApps (array of strings) – For the
analysis.json
file that describes the root application in a complex Windows .NET application, these are the additional application or service components to include in the application container. You can include up to five additional application components in the array.
Examples
The following examples show an analysis.json
file for a
.NET application running on Windows. Your analysis.json
file
configuration can vary by the type of .NET application you are migrating, its
dependencies, and whether you want it to run in a single container or in multiple
containers. Choose the tab that matches your .NET configuration.