WSO2 APIM Docker Image Customization

WSO2 Products Docker Image Customization

I have got a use case where I have to do the containerized deployment of WSO2 APIM & Analytics (v3.2.0) on OpenShift. Also, there was a requirement to customize the docker image prior to the deployment on OpenShift. Below are the steps I used to deploy the customized docker image of apim & analytics (dashboard+worker) on OpenShift Cluster-

1. Download the apim, analytics base pack (3.2.0) from official WSO2 WebSite
2. For APIM/Analytics extract the zip package
3. Navigate to $PRODUCT_HOME/bin
4. Locate the file wso2update_linux and make sure file has execute permission or do [chmod +x wso2update_linux]
5. Execute the file ./wso2update_linux [below snippets are for in-place updates for analytics, same applies to apim as well]
---------------------------------------------------------------------------------------------
[kumar@dev001 bin]$ ./wso2update_linux
Initializing updates with credentials
Please press 'enter' to continue with a Trial subscription.
If you already have a WSO2 Subscription, please enter your credentials to continue.

Email: kumar1.gaurav@lntinfotech.com
Password for kumar1.gaurav@lntinfotech.com:
Authenticating
Authenticated user kumar1.gaurav@lntinfotech.com
Checking for latest update tool version
A new update is available
Attempting to download and update the WSO2 Update Tool
Update tool client has been updated. Please re-run the tool with necessary parameters
---------------------------------------------------------------------------------------------
[kumar@dev001 bin]$ ./wso2update_linux
Initializing updates with credentials
Please press 'enter' to continue with a Trial subscription.
If you already have a WSO2 Subscription, please enter your credentials to continue.

Email: kumar1.gaurav@lntinfotech.com
Password for kumar1.gaurav@lntinfotech.com:
Authenticating
Authenticated user kumar1.gaurav@lntinfotech.com
Checking for latest update tool version
A new update is available
Attempting to download and update the WSO2 Update Tool
Update tool client has been updated. Please re-run the tool with necessary parameters
---------------------------------------------------------------------------------------------
[kumar@dev001 bin]$ ./wso2update_linux
Checking for latest update tool version
-------------- Welcome to WSO2 Updates --------------

Checking for updates
The latest update level is 'wso2am-analytics-3.2.0.20'.
This consists of 28 updates applied on top of 'wso2am-analytics-3.2.0.0'
[WARNING]
 The update level 'wso2am-analytics-3.2.0.20' consists of 7 critical security updates applied on top of 'wso2am-analytics-3.2.0.0'.
WSO2 strongly recommends to use 'wso2am-analytics-3.2.0.20' distribution in production as soon as possible.
Creating a backup of '/data1/u01/binaries/wso2_wum_27092021/wso2am-analytics-3.2.0'
Successfully created the backup at : /home/appadmin1/.wso2-updates/backup/wso2am-analytics-3.2.0-c3b350f0-baf3-4e97-b692-cf05f87ab38a
Downloading updates
Downloading files... [81/81] - 0s remaining
Updating product
wso2am-analytics-3.2.0 updated successfully
6. Now the pack has been updated to version 3.2.0.20
rename the root directory to wso2am-analytics-3.2.0.20
7. Zip it [zip -r wso2am-analytics-3.2.0.20.zip wso2am-analytics-3.2.0.20
8. Now this updated zip is ready for creating the docker image
9. Structure for creating the docker image
|-Project
|-Dockerfile
|-custom.zip
|-docker-entrypoint.sh
|-PRODUCT.zip (wso2am-analytics-3.2.0.20.zip or wso2am-3.2.0.85.zip)
10. Building the image- execute below docker commands inside the project root directory
sudo docker build -t wso2am:3.2.0.85 .
sudo docker build -t wso2am-analytics:3.2.0.20 .
sudo docker build -t wso2am-worker:3.2.0.20 .
11. New image is available in local docker repo. Validate the same as
sudo docker images
12. Tag the image to respective remote repos apim-dev, apim-test
sudo docker tag wso2am:3.2.0 default-route-openshift-image-registry.apps.devtest.domain.local/apim-dev/wso2am:3.2.
sudo docker tag wso2am-analytics:3.2.0.20 default-route-openshift-image-registry.apps.devtest.domain.local/apim-dev/wso2am-analytics:3.2.0.20
sudo docker tag wso2am-worker:3.2.0.20 default-route-openshift-image-registry.apps.devtest.domain.local/apim-dev/wso2am-worker:3.2.0.20
13. Now use the images in respective YAML file for resources creation in OpenShift/Kubernetes
 

Comments

Popular posts from this blog

Oracle SOA Suite- Implementing Email Notification

Oracle SOA Suite 12c- PKIX path building failed & unable to find valid certification path to requested target

Migration of Oracle SOA Suite Composite from 11g to 12c