简体   繁体   中英

MobileFirst container image on IBM Bluemix - how can I customize it?

I'm using the MobileFirstStarter image available on IBM Bluemix.

I know the MobileFirstStarter image has some limitations such as allowing only one runtime, and deployed assets getting wiped out every time you redeploy the container, but is there a limitation on adding additional wlapp and adapters to this image using Dockerfile?

More details:

I can create a new container based on the MFStarter image by using a Dockerfile, either via the ICE command line interface or the delivery pipeline on IBM DevOps Services.

However, I would like to have instructions on the Dockerfile to add files (ie .wlapp and .adapter) from my local environment to the MobileFirst Server, so when the image is built and the container is started, those applications and adapters will already be in the MobileFirst Server's catalog (ie seen on the Server's console).

My docker file simply starts with the default MFStarter image, then adds the content from "DEPLOY_DIR" folder to /opt/ibm/wlp/usr/servers/BluemixServer/dropins/ .

What would be wrong with this configuration? The container is deployed successfully, I open the MFServer console, but I can't see the wlapp and adapters that came from my local DEPLOY_DIR, only the default ones related to the WishList sample application that comes with the MFStarter image.

Full Dockerfile content below:

from registry.ng.bluemix.net/ibm-mobilefirst-starter:latest

ENV DEPLOY_DIR /bin

# Add wlapp files
ADD $DEPLOY_DIR/*.wlapp /opt/ibm/wlp/usr/servers/BluemixServer/dropins/

# Add adapter files
ADD $DEPLOY_DIR/*.adapter /opt/ibm/wlp/usr/servers/BluemixServer/dropins/

Thanks!

I know the MobileFirstStarter image has some limitations such as allowing only one runtime, and deployed assets getting wiped out every time you redeploy the container, but is there a limitation on adding additional wlapp and adapters to this image using Dockerfile?

You cannot add applications and adapters to this image . The only way to add is by deploying the .wlapp and .adapter files.

Also,
It depends on the database, because that is where the .wlapp and .adapter files are.

If you will use a remote database then once pushing the image to your IBM Container, and given that it is set up correctly, once accessing the MobileFirst Console the applications and adapters should still be displayed and functional (other than the preview ability which is not meant to work in remote server deployments).

@ricardo, like Idan says this image is not meant for full blown development - its meant for demo. What you really want is to use the developer image - not the quickstarter image. use the procedure here https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/bluemix/run-foundation-on-bluemix/ This will yield a image that contains your development artifacts like wlapps and adapters deployed on the server as part of the image build. This also comes with a docker file that you can tweak if you wish. Hope this helps

You can deploy your own .wlapp / .wladapter onto the starter image. However, the limitation is that you can deploy the app / adapter only into the pre-shipped MobileFirstStarter project / runtime. The recommended approach is to use either the MFP Operations console or MFP CLI to deploy .wlapp / .wladaper.

Having said, you could play around with the Dockerfile as follows to have the apps and adapters deployed at container start up.

Assuming you've all your .wlapp and .wladapter files under mfp-apps-adapters folder, the dockerfile could be as follows:

FROM registry.ng.bluemix.net/ibm-mobilefirst-starter:latest
RUN mkdir -p /mfp_apps_adapters
COPY mfp_apps_adapters /mfp_apps_adapters

#Just use curl to run the REST APIs with the username and password you’ve 
set for the admin console. You can also script this in a shell script, 
copy the script into the image and then run through the deployment of 
apps and adapters using the REST APIs. 
http://www-01.ibm.com/support/knowledgecenter/SSHS8R_7.1.0/com.ibm.worklight.apiref.doc/apiref/c_restapi_oview.html?lang=en

Also refer: https://developer.ibm.com/mobilefirstplatform/2015/10/25/running-ibm-mobilefirst-starter-container-locally/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM