Configuring webMethods Microservices Runtime in a Docker container
Tags: webmethods, integration, microservices, docker
Published: 2022-01-05 09:55:42

---
title: Configuring webMethods Microservices Runtime in a Docker container
published: true
date: 2021-12-30 22:30:31 UTC
tags: webmethods, integration, microservices, docker
canonical_url: https://tech.forums.softwareag.com/t/configuring-webmethods-microservices-runtime-in-a-docker-container/254219
---

## Overview

webMethods Microservices Runtime provides scripts that allows to generate Dockerfile and Docker images. In previous articles, we described ways to create Docker images and run Docker containers. In the earlier versions of Microservices Runtime, it was required to embed configurations inside a Docker image and one can only update an existing configuration using configuration variables template. In version 10.11 and latest fixes of earlier versions, Microservices Runtime allows creation of configurations using configuration variable template. This article provides an overview on how same Docker image of Microservices Runtime can be used across different stages in the development lifecycle with different configurations.

## Prerequisites

- You have some familiarity with the Docker technology.

- You have Docker installed in your environment and it is running as a daemon.

- You have familiarity with support of Docker in webMethods Microservices Runtime. More information about this can be found at [Microservices Runtime with Docker](https://tech.forums.softwareag.com/t/getting-started-with-webmethods-microservices-runtime-with-docker/237178)

## Environment Variables Support in Microservices Runtime

Microservices Runtime supports different environment variables that can be supplied when starting a Docker container. These environment variables allow to supply License file (_SAG\_IS\_LICENSE\_FILE_) for the container, setting minimum (_JAVA\_MIN\_MEM_) and maximum (_JAVA\_MAX\_MEM_) heap size for the container and providing configuration variables template (_SAG\_IS\_CONFIG\_PROPERTIES_). More information about these environment variables can be found at [Environment Variables](https://documentation.softwareag.com/webmethods/microservices_container/msc10-11/10-11_MSC_PIE_webhelp/index.html#page/integration-server-integrated-webhelp%2Fto-sag_environment_variables_2.html%23)

## Configuration Variables Support in Microservices Runtime

Configuration variables template is a way to configure container running Microservices Runtime. For this article, we will use the Docker image of Microservices Runtime that is published on Dockerhub [Docker Hub](https://hub.docker.com/_/softwareag-webmethods-microservicesruntime), however you can also use Docker images created in your environment. One of the ways in which configuration variables template can be supplied to a container is using _SAG\_IS\_CONFIG\_PROPERTIES_ environment variable.

Configuration Variable template is Java properties file containing key-value pairs, where key represents a particular asset’s property for which you can specify a value. Value specified for individual keys can have one of the following formats

- Plain text

- Environment variable, as an example value can be $env{JDBC\_URL}, where _JDBC\_URL_ is the environment variable containing the actual value that will be substituted at startup time

- Encrypted Value, as an example value can be {AES}CszC/…, you can use Microservices Runtime’s Admin UI to generate encrypted value. Documentation [here](https://documentation.softwareag.com/webmethods/microservices_container/msc10-11/10-11_MSC_PIE_webhelp/index.html#page/integration-server-integrated-webhelp%2Fto-configuration_variables_for_docker_9.html%23) provides more information on this.

- Kubernetes Secrets, as an example value can be $secret{jdbcurl}, where jdbcurl is the secret stored in Kubernetes.

## Specifying Configuration Variables Template in Microservices Runtime

Following command can be used to supply configuration variables template to Docker container.

```
docker run -d --name msrcontainer -p 5555:5555 -v /opt/data/customapp.properties:/opt/data/customapp.properties -e SAG_IS_CONFIG_PROPERTIES=/opt/data/customapp.properties store/softwareag/webmethods-microservicesruntime:10.11.0.0

```

Please note that in the example above, you will need to create customapp.properties file in your HOST machine under /opt/data directory with content as below.

```
globalvariable.variable1.value=newTestValue
globalvariable.variable2.value={AES}4LxEGBJV9ULP3Im7L8mrMzyKlsk7mNcMZh5J5LN9h+gZemVaEDK/i1nOfIdbbWyk
globalvariable.variable2.isSecure=true
proxyserver.proxyAlias.host=DummyHost
proxyserver.proxyAlias.password={AES}Y5IgMqjfvkgbg7p5VUZztw==
proxyserver.proxyAlias.port=7777
proxyserver.proxyAlias.username=proxyProdUser
jdbc.Oracle.dbURL=$env{JDBC_URL}
jdbc.Oracle.password={AES}Z00ucoomUFviQLodMDpoJg\=\=
jdbc.Oracle.userid=testuser
settings.watt.server.threadPool=100
settings.watt.server.threadPoolMin=10

```

Once container is up and running, Microservices Runtime will have the following configurations created

- JDBC Pool with Oracle as alias, testuser as user ID and URL is updated with the value specified in _JDBC\_URL_ environment variable
- Global Variable variable1 with value as newTestValue
- Global Variable vairable2 with value provided as encrypted value and it is configured as password
- Extended Settings for threadPool and threadPoolMin are set as 100 and 10 respectively
- Proxy Server alias with alias as proxyAlias, host as DummyHost, port as 7777

You can login to Admin UI to check if execution and steps are described above are successful in your environment.

Proxy Servers UI will display configuration for Proxy server as below – [http://localhost:5555/WmAdmin/#/integration/dsp/settings-network.dsp](http://localhost:5555/WmAdmin/#/integration/dsp/settings-network.dsp)

[![image](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/e/9/e9ddcd29a7f41c346fc71a4bf2eb1b54f3e02dfe_2_690x161.png)](https://aws1.discourse-cdn.com/techcommunity/original/3X/e/9/e9ddcd29a7f41c346fc71a4bf2eb1b54f3e02dfe.png "image")

Global Variables UI will display configuration for Configuration Variables as below – [http://localhost:5555/WmAdmin/#/integration/dsp/settings-global-variables.dsp](http://localhost:5555/WmAdmin/#/integration/dsp/settings-global-variables.dsp)

[![image](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/b/d/bdd53c9874d12ca1ca0f99e08154aba8fab2b540_2_690x246.png)](https://aws1.discourse-cdn.com/techcommunity/original/3X/b/d/bdd53c9874d12ca1ca0f99e08154aba8fab2b540.png "image")

Similarly, you can check configurations created for other artifacts in their respective screens.

**Note** : Please note that not all configurations can be created using this approach. List of configuration assets that can be created are specified in [Documentation](https://documentation.softwareag.com/webmethods/microservices_container/msc10-11/10-11_MSC_PIE_webhelp/index.html#page/integration-server-integrated-webhelp%2Fto-configuration_variables_for_docker_11.html%23). If there are any configurations that is missing, provide us your inputs and we will add those configurations in future versions of Microservices Runtime.

## Generate Configuration Variables Template in Microservices Runtime

Microservice Runtime’s Admin UI allows creation of template from running Microservices Runtime.  
You can use Administration => Configuration variables => Generate Configuration Variables Template from Admin UI to create sample configuration variables template. [Documentation](https://documentation.softwareag.com/webmethods/microservices_container/msc10-11/10-11_MSC_PIE_webhelp/index.html#page/integration-server-integrated-webhelp%2Fto-configuration_variables_for_docker_7.html%23) provides more details on this action.

## Conclusion

This article described a way to configure Microservices Runtime in a container. By doing this, you can reuse your Docker image of a Microservices Runtime across multiple stages in the development lifecycle.

[Check original article](https://tech.forums.softwareag.com/t/configuring-webmethods-microservices-runtime-in-a-docker-container/254219)