<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 2

In a previous post, I talked about how to use the Embotics vCommander Cloud Management Platform to deploy the Docker engine.  Now it’s time to pile on the containers.

When a user makes a request for a Docker environment, they need to choose one or more containers to deploy. I’ll show you two ways of allowing users to choose containers: first, a multi-selectable list of the top 10 most popular containers on Docker Hub, and second, an input field that accepts a comma-separated list of container names.

 docker-form.png

In vCommander, we lay out the form in the service catalog blueprint:

docker-bp-form.png

Now that we have a list of the requested containers, we can use two vCommander variables to retrieve the form values in a completion workflow. In the first article, I focused on workflow steps 1 through 7.  Now we’ll look at steps 8 through 12.

In step 8, we iterate through the list of popular containers, stored as a comma-separated list in the variable.  Here’s the command line to accomplish this:

IFS=',' ;for i in `echo "#{target.settings.customAttribute['Popular Containers']}"`; do sudo docker pull $i; done

dckr-wf8.png

In step 9, we process the user-specified list of containers. Here’s the command line:

IFS=',' ;for i in `echo "#{target.settings.inputField['Docker Hub Container']}"`; do sudo docker pull $i; done

dckr-wf-9.png

Step 10 queries the Docker engine for a list of installed containers. Make sure the Program Output option is set to Capture program output as comment.

dckr-wf10.png

vCommander allows you to use the output from a previous step. In step 11, we use the output from step 10 to send a list of installed containers to the requester.

dckr-wf11.png

Optionally, you can populate a custom attribute with the list of containers that were installed on the Docker engine, using the Set Custom Attribute workflow step. Here are the two variables containing the list of containers:

#{target.settings.inputField['Docker Hub Container(s)']}

#{target.settings.inputField['Popular Containers']}

dckr-wf12.png

And that’s how vCommander can deploy containers using a blueprint form and a completion workflow. To learn more about vCommander blueprint forms, see Managing the Service Catalog in our online help. See Creating a Completion Workflow to learn more about completion workflows.

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