Running a Docker Image as an Application Instance
Version: 1.0
Last Modified: 10/22 /2020
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.
Hello World NGINX Docker Image uploaded at the end of that guide as our example image we want to deploy.
We will also be using theTo get started, login to the MobiledgeX Console. If you do not have an account, please head over to our Getting Started page.
Step 0: Create a Cluster Instance (Optional)
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
- Operator: TDG
- Cloudlet : Pick any one. For example, Hamburg-Main
- Deployment Type : Docker
- IP Access: Dedicated
- Flavor: m4.small
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.
For our Hello World image, input the following
- App Name : HelloWorld
- App Version: 1.0
- Deployment: Docker
- Access Type: Direct
- Image Path: docker.mobiledgex.net/helloworld/images/helloworld:1.0 (this should pre-populate based on the name and version provided)
- Default Flavor: m4.small
- Ports: Click the
+
icon to add one port and then add the following:- Port Number : 80
- Protocol: TCP
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:
If you DID create a Cluster Instance
in Step 0,
- Auto-Cluster: Keep Off
- Cluster: hwcluster
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.