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
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.
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.
Always provide the full path to a valid directory location in the Docker host.
Consider the following directory structure.
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
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.