Skip to end of metadata
Go to start of metadata

The following sections explain the process involved in running containers and backing up and restoring images.

Running Docker images

After building the images, use the run.sh script to run the Docker images. When the run script is invoked, it starts a container based on the specified product Docker image.

For example, when executing the <DOCKERFILES_HOME>/wso2am/ run.sh script with the following parameters, it results in a running container which contains the WSO2 API Manager Docker image. The run.sh script prompts the user with the option to SSH into the running container.

./run.sh -v 1.10.0
WSO2AM default container started: [name] wso2am-default [ip] [container-id] 1509d074ab98da5e77853a3f9757bb7a3f6928f445a8d47e01a084cbe1130f18
Connect to the spawned container? (y/n): y

A detailed description of all functionalities supported by the run script is described in the helper scripts page.


Copying artifacts from host machine to the container

It is possible to copy or overwrite any artifact under the home directory of the Carbon server, which is referred to as <CARBON_HOME>, in the running container by sharing a directory between the host and container. The host path provided is shared with the /mnt/wso2 directory in the running container.

For an example, when the run.sh script is executed with following parameters, it shares the /home/isuru/artifacts directory with the running container.

Running with a shared host directory
./run.sh -v 1.10.0 -m /home/isuru/artifacts

Always provide the full path to a valid directory location in the Docker host.


Consider the following directory structure.

Shared directory structure
-- artifacts 
	|-- carbon-home
	|	|-- repository
	|		|-- deployment
	|		|	|-- server
	|		|		|-- webapps
	|		|			|-- testapp.war
	|		|-- components
	|				|-- patches
	|					|-- patch9999
    |-- other-files


Any configurations or files that are under the directory carbon-home are copied to the actual <CARBON_HOME> of the running container. In the above sample directory structure, testapp.war is copied to the <CARBON_HOME>/repository/deployment/server/webapps directory and patch9999 is copied to the <CARBON_HOME>/repository/components/patches directory.

Please note that the host machine directory, which is shared with the containers, should have read, write and executable permission for everyone. Use the following command to grant all permissions to everyone in the shared folder.

sudo chown -R 777 <shared_directory_path>
  • No labels