In this guide, we will show how to run a Docker Image as a Container Application Instance on MobiledgeX. For this guide, we will be assuming that you have already uploaded your Docker image to the MobiledgeX Docker Repository as was done in the Uploading Your First Docker Image Guide.
MobiledgeX offers an auto-cluster feature when creating an Application Instance in Step 2, which will setup the Cluster resources needed before running your application. If you choose to use the auto-cluster feature as opposed to defining the cluster parameters like below, you can skip this step.
To get started, click on the Cluster Instances tab in the console. A Cluster Instance represents the compute resources that are needed to run your Docker image. You can learn more about Cluster Instances in our MobiledgeX Cluster guide.
In the top right, click the + icon to start defining a new Cluster Instance. This will open up a Form that needs to be filled out. For our Hello World application, fill out the information with the following :
Region : EU
Name : hwcluster
Cloudlet : Pick any one. For example, Hamburg-Main
Then Click Create, which will begin the process allocating the necessary resources for your Application on the Cloudlet you selected.
Step 1: Define your Application
Next, head over to the Apps Tab to define the parameters needed for your Docker Image to run successfully. For more information on Application Definition, you can refer to this guide. Then, just like with Clusters, click the + icon to start filling out the Application Form.
Ports: Click the + icon to add one port and then add the following:
Port Number : 80
Couple Important Points
The App Name and Version provided in the form do NOT have to match the App Name and Version of your Docker Image, but it is recommended to keep them the same
The Default Flavor is only used if we do not create a Cluster and use it in the next step. If you created a Cluster above in Step 0 and plan to use it, this field will NOT be used.
Click Create, which will Validate and Save our Application information.
Step 2: Deploy your Application as an Application Instance
Lastly, now that we have set up the resources needed to run our application (Cluster) and defined the parameters of our server (Application Definition), we can now run our Application as an Application Instance. You can think of this as running docker container run on a MobiledgeX Cloudet.
On the Apps Page, click on the menu button for the HelloWorld Application we just defined and select Create Instance.
This opens up the Application Instance creation form. Input the following:
Cloudlet: Hamburg-Main (the same one you selected for your cluster)
If you DID NOT create a Cluster Instance in Step 0,
Auto-Cluster: Turn On
IP Access: Dedicated
Click Create, which will start the process of running your image on our cloudlet, in this case Hamburg-Main. Give the process a couple minutes and then if it is all successful, head over to the Application Instances tab to see your newly created Application Instance.
Step 3: Test Your Application
On the Application Instance tab, click on the HelloWorld Application Instance you just created, which will provide a status of the Application. You should see a field called URI, which is the publically accessible domain unique to your instance. For Hello World, copy and paste that into a web browser and you should now see our beautiful Hello World webpage.