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:
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:
Rest of the terms like
Hosts are pretty straight forward.
Run Couchbase in Oracle Container Cloud Service
- Click on
- Oracle Container Service only supports Compose v2. So a simple Compose file definition can be used for service definition:YAML123456789version: "2"services:db:image: arungupta/couchbaseports:- 8091:8091- 8092:8092- 8093:8093- 11210:11210
arungupta/couchbaseis 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:
Alternatively, you can use the builder or
docker runcommand as well. In our case, use the Compose definition and then specify the Service Description.
- Click on
Saveto save the service definition. The updated list now includes Couchbase service:
- Click on
Deployto deploy the container:
- Take the defaults and click on
Deployto start the deployment.
- The Docker image is download and the container is started. The screen is refreshed to show
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 Namecolumn to see more details about the container:
The typical output that you’ll inspect from the
docker inspectcommand is shown here.
- Click on
View Logsto see the container logs:
This is equivalent to the
docker container logscommand.
These logs are generated from when Couchbase REST API is configuring the server.
- Click on Hosts to see the complete list of hosts:
- A single instance of container is running. Select the host that is running the container to see more details:
public_ipof 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.
Now, let’s access the Couchbase Web Console. In our case, this is available at 184.108.40.206:8091. This shows the main login screen as:
Use Administrator as Username and password as password, click on Sign In to see the main screen of the console:
Click on Server Nodes to see that data, index and query services are running:
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?