Getting Started with Oracle Container Cloud Service explained how to get started with Oracle’s managed container service. Well, the intent was to show how to get started but getting to “getting started” was itself quite involving. And now this blog will really show how to run a simple Docker container to Oracle Container Service.

Oracle Container Service is built upon Oracle’s StackEngine acquisition that was completed 1.5 years ago. The basis for this blog is going to be a 4 node cluster (1 manager and 3 workers) created following the steps in Getting Started with Oracle Container Cloud Service.

Make sure you note down the user name and password of the service specified during the creation. It is golden, and there is no way to either retrieve it or reset it afterwards. UPDATE: @kapmani clarified that the password can be reset by logging into the manager node.

Anyway, the dashboard looks like:

Oracle Cloud Dashboard

Similarly, Container Cloud Console with 4 nodes looks like:

Container Cloud Service is accessible using REST API as explained in About Oracle Container Cloud Service REST API. The console itself uses the REST API for fulfilling all the commands.

Oracle Container Cloud Service Concepts

Let’s learn about some concepts first:

  • Service – Service comprises of the necessary configuration for running a Docker image as a container on a host, plus default deployment directives. Service is neither container nor image running in containers. It is a high-level configuration objects that you can create, deploy, and manage using Oracle Container Cloud Service. Think of a service as a container ‘template’, or as a set of instructions to follow to deploy a running container.
  • Stack – Stack is all the necessary configuration for running a set of services as Docker containers in a coordinated way and managed as a single entity, plus default deployment directives. Think of it as multi-container application. Stacks themselves are neither containers nor images running in containers, but rather are high-level configuration objects that you can create, deploy, and manage using Oracle Container Cloud Service. For example, a stack might be one or more WildFly containers and a Couchbase container. Likewise, a cluster of database or application nodes can be built as a stack.
  • Deployment – A Deployment comprises a service or stack in which Docker containers are managed, deployed, and scaled according to a set of orchestration rules that you’ve defined. A single deployment can result in the creation of one or many Docker containers, across one or many hosts in a resource pool.
  • Resource Pool – Resource pools are a way to organize hosts and combine them into isolated groups of compute resources. Resource pools enable you to manage your Docker environment more effectively by deploying services and stacks efficiently across multiple hosts.Three resource pools are defined out of the box:
    Oracle Cloud Default Resource Pool

Rest of the terms like Containers, Images and Hosts are pretty straight forward.

Run Couchbase in Oracle Container Cloud Service

  • Click on ServicesNew Service
  • Oracle Container Service only supports Compose v2. So a simple Compose file definition can be used for service definition:

    The image arungupta/couchbase is built from github.com/arun-gupta/docker-images/tree/master/couchbase. It uses Couchbase REST API to pre-configure the Couchbase server. The common Couchbase networking ports for application development are also exposed.

    In the YAML tab, use the Compose definition from above:
    Docker Container Oracle Cloud
    Alternatively, you can use the builder or docker run command as well. In our case, use the Compose definition and then specify the Service Description.

  • Click on Save to save the service definition. The updated list now includes Couchbase service:
    Oracle Cloud Couchbase Service
  • Click on Deploy to deploy the container:
    Oracle Cloud Deploy Couchbase
  • Take the defaults and click on Deploy to start the deployment.
  • The Docker image is download and the container is started. The screen is refreshed to show Deployments:Oracle Cloud Deployments Couchbase
    A single instance of the container is now up and running,  Other details like resource pool, hostname and uptime are also displayed.

Details about Couchbase Container in Oracle Cloud

Let’s get some details about the Couchbase container in Oracle Cloud:

  • Click on the container name shown in Container Name column to see more details about the container:
    Oracle Cloud Containers Couchbase Details
    The typical output that you’ll inspect from the docker inspect command is shown here.
  • Click on View Logs to see the container logs:
    Oracle Cloud Containers Couchbase Logs
    This is equivalent to the docker container logs command.
    These logs are generated from when Couchbase REST API is configuring the server.
  • Click on Hosts to see the complete list of hosts:
    Oracle Cloud Container Couchbase Hosts
  • A single instance of container is running. Select the host that is running the container to see more details:
    Oracle Cloud Containers Couchbase Host Details
    Note the public_ip of the host. This IP address will be used to access Couchbase Web Console later.Another key part to note here is that this host is running Docker 1.10.3. That is the case with other hosts as well, as expected.

Access Couchbase

Now, let’s access the Couchbase Web Console. In our case, this is available at 129.152.159.64:8091. This shows the main login screen as:

Oracle Cloud Couchbase Web Console

Use Administrator as Username and password as password, click on Sign In to see the main screen of the console:

Oracle Cloud Couchbase Web Console Main Screen

Click on Server Nodes to see that data, index and query services are running:

Oracle Cloud Couchbase Web Console Server Nodes

Pretty cool, eh!

A future blog post will show how to create a Couchbase cluster, run a simple application against this cluster and other fun stuff.

Use any of the Couchbase Starter Kits to get started with Couchbase.

Want to learn more about running Couchbase in containers?

Posted by Arun Gupta, VP, Developer Advocacy, Couchbase

Arun Gupta is the vice president of developer advocacy at Couchbase. He has built and led developer communities for 10+ years at Sun, Oracle, and Red Hat. He has deep expertise in leading cross-functional teams to develop and execute strategy, planning and execution of content, marketing campaigns, and programs. Prior to that he led engineering teams at Sun and is a founding member of the Java EE team. Gupta has authored more than 2,000 blog posts on technology. He has extensive speaking experience in more than 40 countries on myriad topics and is a JavaOne Rock Star for three years in a row. Gupta also founded the Devoxx4Kids chapter in the US and continues to promote technology education among children. An author of several books on technology, an avid runner, a globe trotter, a Java Champion, a JUG leader, NetBeans Dream Team member, and a Docker Captain, he is easily accessible at @arungupta.

Leave a reply