<img src="https://certify.alexametrics.com/atrk.gif?account=VdU0q1FYxz20cv" style="display:none" height="1" width="1" alt="">
Embotics Cloud Management Blog

Using vCommander to Deploy a Docker Environment Part 1

What is Docker?

Docker containers wrap up a piece of software in a complete file system that contains everything it needs to run: code, runtime, system tools, system libraries – anything you can install on a server. This guarantees it will always run the same, regardless of the environment it is running in.

Developers can now use vCommander to automatically deploy a linux VM and install the Docker Engine. Once the machine is provisioned the developer can SSH into the VM and run Docker Commands against the a Docker Engine.

In our example, we’ll use CentOS, but Docker can be installed on most flavors of Linux.

First we configure the Service Catalog entry. I provide a clear, understandable name and description as always, and also uploaded the Docker icon and created a category.

dckr1.png

We’ll use an existing CentOS minimal install template that already has net-tools and VMware tools installed.

dckr2.png
For the rest of the service catalog definition we can use the default values or customize as necessary.

dckr3.png
We complete the wizard to save the Service Catalog entry. Next we’ll configure a completion workflow to install the Docker Engine when the VM gets deployed.

dckr5.png

The workflow is broken down into seven steps. In Step 1, we make sure that the deployed VM has obtained an IP address before the workflow continues.

dckr6.png

The rest of the workflow will use the Execute SSH step with credentials I’ve already stored. Each also uses the variable #{target.ipAddress} to connect to the new VM.

In Step 2 we will update the VM by issuing the command sudo yum -y update.

dckr7.png
Step 3 adds the Docker repository to yum by issuing the following command:

sudo tee /etc./yum.repos.d/docker.repo <<-‘EOF’
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF

dckr8.png
Step 4 installs the Docker Engine. We use yum to pull the newest version of the Docker Engine with the command sudo yum install -y docker-engine.

dckr9.png

Step 5 starts the Docker Engine with the command sudo service docker start.

dckr10.png

Step 6 ensures that the service starts on reboot with the command sudo chkconfig docker on.

dckr11.png

Step 7 is optional, testing the Docker Engine by setting up the hello world container. This is done with the command sudo docker run hello-world.

dckr12.png
The last thing we need to do is assign this workflow to the component of the service catalog item we first created, and complete the Wizard.

dckr13.png
Now you can request a Docker host and install popular containers like MySQL, busybox, postgres, etc. from the command line of the Docker host.

In a subsequent article we’ll build on this example and show you how to let the person requesting the Docker environment pick containers to be preinstalled on the Docker host.

Topics: Integrations Application / Service Delivery Cloud Management Platform (CMP)