After referring to the instructions in our knowledgebase article Using vCommander to Deploy a Docker Environment, you can follow the procedures here to begin deploying docker containers.


When a user makes a request for a Docker environment, they need to choose one or more containers to deploy. Here we'll cover 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 article Using vCommander to Deploy a Docker Environment, we covered 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-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.