My webMethods Server 10.7 | 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 | Custom Applications in My webMethods Server Containers
 
Custom Applications in My webMethods Server Containers
Despite the general recommendation to include all required custom applications before generating a Docker image for a My webMethods Server installations, in certain occasions and especially for non-production environments you might require to install a custom application in a container on top of the image from which you start the container. My webMethods Server containers include a predefined directory /MWS/volumes/apps on the container file system, in which you can place assets to copy to the /deploy directory of the My webMethods Server instance. You can install custom applications in a container in one the following ways:
*Using the docker cp command - to copy the application package from the host machine to the /MWS/volumes/apps directory of a running container. This approach hot deploys the application into an already running container. However, you cannot use this approach if your application includes dependencies to external libraries. Docker does not provide a dedicated command to remove an asset that you place in a container directory using the docker cp command. To uninstall the application from My webMethods Server, navigate to the applications directory in the container and use the rm command.
*Using a bind-mounted directory from the host files system - use the -v option of the docker run command to bind mount a directory on the host file system that contains one or more applications to deploy when starting up a new container. At container startup My webMethods Server copies all files from the host directory to the /MWS/volumes/apps of the container, and subsequently - to the/deploy directory for the instance. Once the directory is mounted, you can replace existing, or add new applications to deploy to My webMethods Server. To remove an application, delete it from the directory.
*Using a named volume - use the -v option of the docker run command to mount a named volume that contains one or more applications to deploy when starting up a new container. At container startup My webMethods Server copies all files from the volume to the /MWS/volumes/apps of the container, and subsequently - to the /deploy directory for the instance. Once the volume is mounted, you can replace existing, or add new applications to deploy to My webMethods Server. To remove an application, delete it from the volume.
My webMethods Server persists a list of all deployed applications in a .properties file on the MWS/volumes/data directory in the container and its mounted volume, which is anonymous by default.
You can override the container locations of both the /apps and the /data directories, using the environment variables for My webMethods Server. For more information, see Environment Variables that My webMethods Server Containers Support.
Examples
*The following example creates the named volume tasks and uses it to deploy task applications to a container, created from the webM107 image:
docker volume create tasks
docker run -e
DB_URL="jdbc:wm:sqlserver://dbhost:1439;databaseName=MWSDOCKER;user=wmuser;password=manage"
-e DB_TYPE=ms -v tasks:/opt/softwareag/MWS/volumes/apps -p 8585:8585 webM107
*The following example uses bind-mounts the host directory /home/myvm/taskapps to deploy task applications to a container, created from the webM107 image:
docker run -e
DB_URL="jdbc:wm:sqlserver://dbhost:1439;databaseName=MWSDOCKER;user=wmuser;password=manage"
-e DB_TYPE=ms -v
/home/myvm/taskapps:/opt/softwareag/MWS/volumes/apps -p 8585:8585
webM107
*The following example uses bind-mounts the host directory /home/myvm/taskapps to deploy task applications to a container, created from the webM107 image and copies all applications to the /tasks directory in the container, instead of in the default /apps directory:
docker run -e
DB_URL="jdbc:wm:sqlserver://dbhost:1439;databaseName=MWSDOCKER;user=wmuser;password=manage"
-e DB_TYPE=ms -v /home/myvm/taskapps:/opt/softwareag/MWS/tasks -e
APPS_DIR=/opt/softwareag/MWS/tasks -p 8585:8585
webM107