Reputation: 107
I created a MYSQL service and bound it to a cloud foundry application in Bluemix. Now I created a Mobilefirst-Container. How can I bind this container to the CF-App in order to get data from the database through the mobilefirst-Adapter?
Thank you in advance.
Upvotes: 0
Views: 93
Reputation: 4590
You can bind the cloud foundry application when you create the container running one of the following commands (depending on the cli you are using for IBM containers):
$ cf ic run -p 80 -p 9080 -p 9443 --env CCS_BIND_APP=my_app --name my_container_name registry.ng.bluemix.net/ibm-mobilefirst-starter
or
$ ice run -p 80 -p 9080 -p 9443 --bind my_app --name my_container_name registry.ng.bluemix.net/ibm-mobilefirst-starter
Alternatively you can bind the application using the UI as well. In this case expand the Advance Options tab when creating the container in the UI. You will then see a Service Binding menu when you can select the cloud foundry application to bind to the container.
The application you bind to the container is called a bridge application. In the container you will not have access to the application itself, but only to the services bound to that application. You can access the services via the VCAP_SERVICES
environment variable for the specific services.
More details in the documentation here.
Upvotes: 1