Directories in a DataPower Docker image
How to manage DataPower® files in a DataPower Docker image.
The following table lists how the DataPower directories correspond to the container directories.
| DataPower directory | Container directory |
|---|---|
| cert: | /opt/ibm/datapower/root/secure/usrcerts |
| config: | /opt/ibm/datapower/drouter/config |
| local: | /opt/ibm/datapower/drouter/local |
| Predefined RAID partition, unencrypted | /opt/ibm/datapower/drouter/mnt/raid-volume/raid0 |
| Predefined RAID partition, encrypted for B2B | /opt/ibm/datapower/drouter/mnt/raid-volume/raid0encr |
You can attach a volume on your host to the container directory. The configuration is written to
the attached volume when you save the configuration and is loaded on restart of the DataPower Gateway. You can manage the configuration in the
attached volume with version control and reuse the configuration in the volume among multiple
containers. The following command provides an excerpt of how volumes can be specified with the
docker run
command.docker run \
-v $(pwd)/config:/opt/ibm/datapower/drouter/config \
-v $(pwd)/local:/opt/ibm/datapower/drouter/local \
-v $(pwd)/certs:/opt/ibm/datapower/root/secure/usrcerts \
…Examples that use the DataPower directories
- Adding archive files to config and local directories
- This example assumes an archive file that contains the config and
local directories and uses the
ADDdeclaration for thedrouterdirectory.ADD config.tar.gz /opt/ibm/datapower/drouter ADD local.tar.gz /opt/ibm/datapower/drouter - Adding archive file to the cert directory
- This example assumes an archive file that contains the cryptographic files to add to the
cert directory and uses the
ADDdeclaration for theroot/secure/usercertsdirectory.ADD cert.tar.gz /opt/ibm/datapower/root/secure/usrcerts - Copying files directly
- This example uses the
COPYdeclaration to copy file to thecert,config, andlocaldirectories.COPY mycert.pem /opt/ibm/datapower/root/secure/usercerts/mycert.pem COPY myconfig.cfg /opt/ibm/datapower/drouter/config/myconfig.cfg COPY mycode.js /opt/ibm/datapower/drouter/local/mycode.js