My webMethods Server 10.15 | My webMethods Server Webhelp | Administering My webMethods Server | Startup and Configuration | Using My webMethods Server with Docker | Running and Customizing My webMethods Server Containers | Installing My webMethods Server Components and Custom Applications | Example: Using Parametrized xmlImport Files
 
Example: Using Parametrized xmlImport Files
The following code snippets show how to parametrize the name, alias and provider URL of a directory service and supply different values for these parameters at container startup:
<CONFIG>
<context alias="dir.svc.container">
<wm_xt_ldapdirsvc name="${sys:SvcName}" alias="${sys:SvcAlias}"
providerURL="${sys:SvcUrl}"
baseDN="o=portal"
serviceEnabled="false"
...
...
To supply a specific value for the directory service name, add the following custom JVM property in the custom_wrapper.conf file:
wrapper.java.additional.nnn=-DSvcName=MyDirSvc
Place the custom_wrapper.conf file in a volume, mapped to the profile_cfg directory, and the xmlImport file in a volume, mapped to the assets_cfg directory, then start the My webMethods Server container.
To supply specific values for the alias and providerURL properties of the directory service in the example above, also add the following custom JVM properties:

wrapper.java.additional.nnn=-DSvcAlias=MySvcAlias
wrapper.java.additional.nnn=-DSvcUrl=ldap://host:port
For more information about using xmlImport files in My webMethods Server containers, see Deploying Assets Using xmlImport Files. For more information about how to supply configuration files in My webMethods Server, see Modifying the Configuration of a Container.
When parametrizing properties in an xmlImport file for use with the Docker CLI environment variables, use the env prefix, as follows:
<CONFIG>
<context alias="dir.svc.container">
<wm_xt_ldapdirsvc name="${env:SvcName}" alias="${env:SvcAlias}"
providerURL="${env:SvcUrl}"
baseDN="o=portal"
serviceEnabled="false"
...
...
The following command demonstrates how to substitute parametrized values in the xmlImport files during container startup using environment variables. Before running the container, you must place all xmlImport files in a subdirectory named assets_cfg in the mounted directory.
docker run -e DB_URL="jdbc:wm:sqlserver://dbhost:1439;databaseName=MWSDOCKER;user=wmuser;password=manage"
-e DB_TYPE=ms -v /home/myvm/myconfigs:/opt/softwareag/MWS/configs
-e SvcName=MyDirSvc -p 8585:8585 webM1015