Running a Docker Container with Oracle Container Cloud Service in Three Easy Steps


Options



Before You Begin

Purpose

This tutorial shows you how to run a simple helloworld example application as a Docker container using Oracle Container Cloud Service.

Time to Complete

Less than 5 minutes

Background

The helloworld example application is simply a web page containing a welcome message and a page view counter. The application is stored as a Docker image in the public Docker Hub Registry This tutorial shows you how to use Oracle Container Cloud Service to deploy and run the helloworld example application as a Docker container, and how to confirm the application is working correctly.

Scenario

During this tutorial you will:

  1. Log in to the Oracle Container Cloud Service Container Console.
  2. Deploy and run the helloworld example application as a Docker container.
  3. Use the helloworld application within the running Docker container.

What Do You Need?

Required Resource/Tool: Details:
Web browser A web browser is required for working with Oracle Cloud services. These are the minimum requirements:
  • Microsoft Internet Explorer 11 or later.
  • Google Chrome 29 and later
  • Mozilla Firefox 24 and later
  • Apple Safari 9 and later
Subscription to Oracle Container Cloud Service Before you can use Oracle Container Cloud Service:
  • You, or someone else in your organization, must have ordered and activated an Oracle Container Cloud Service subscription
  • You, or someone else in your organization, must have created an Oracle Container Cloud Service service instance using the Oracle Container Cloud Service Service Console
  • You must know the url and credentials with which to log into the Oracle Container Cloud Service Container Console

For more information, see Using Oracle Container Cloud Service in the Oracle Help Center.


1. Log in to the Container Console

  1. Log in to the Oracle Container Cloud Service Container Console at the URL and using the credentials you’ve received from your administrator.
  2. Oracle Container Cloud Service login page 
    Description of this image

2. Deploy and run the helloworld example application as a Docker container

  1. On the Dashboard page, click Services to display the Services page.

  2. Dashboard page 
    Description of this image

    The Services page shows the example applications provided with Oracle Container Cloud Service.

  3. On the Services page, click the Deploy button beside the helloworld service.

  4. Services page 
    Description of this image

    The Deploy dialog appears, containing default values for:

    • the deployment's name
    • the pool of hosts on which to run the deployment
    • the number of containers to deploy, and how to choose the hosts on which to deploy them
    • Deploy dialog 
      Description of this image
  5. In the Deploy dialog, click Deploy to accept the default values and deploy and start the service.
  6. The Deployments page appears, showing progress details of the deployment you just created.

    To begin with, the Deployments page shows the helloworld image being pulled from Docker Hub Registry.

    Deployments page 
    Description of this image

    After the image has been downloaded, it's started as a Docker container. The Deployments page shows the status of the Docker container as "Running".

    Deployments page 
    Description of this image

3. Use the helloworld application within the running Docker container

  1. On the Deployments page, click on the name of the host in the Hostname column.
  2. Deployments page 
    Description of this image

    The Host page appears, showing details of the host running the container.

  3. On the Host page, copy the value in the public_ip field.
  4. Host Details page 
    Description of this image
  5. Open a new browser window and enter the url to access the helloworld application running inside the container, in the form http://<public_ip>:9000 where:
    •  <public_ip> is the value you copied from the public_ip field on the Host page (for example, 192.0.2.254)
    • 9000 is the host port (9000 is specified as part of the example application's service definition)

    For example, the full url might look like http://192.0.2.254:9000

    When your browser loads the page, the page shows a message like:

    Hello
    Is it me you're looking for?

    Browser window 
    Description of this image

    At the bottom of the page, a page view counter shows the number of times the page has been visited, and initially displays '1'.

  6. Reload the page in the browser window (for example, by clicking Refresh or Reload).
  7. Browser window 
    Description of this image

    The counter at the bottom of the page now displays '2'.

Congratulations! You have successfully run your first Docker container in just a few seconds and used the actual application to confirm that the page view counter is working correctly.

Want to Learn More?