Automated Deploys with Docker Hub and Nirmata
Join the DZone community and get the full member experience.Join For Free
as companies strive to attain achieve software development agility, they are looking to automate each phase of their software development pipeline. the ultimate goal is to fully automate the deployment of code to production, triggered when a developer checks in a fix or a feature. companies such as netflix have built extensive tooling to enable their developers to achieve this level of sophisticated automation . in this post, i will describe how deployments of containerized applications can be completely automated with github, docker hub and nirmata.
docker hub has built-in integration with github and bitbucket to automatically build a docker image when change is committed to a github repository that has automated builds enabled . the only requirement is that a dockerfile be placed in that repository. this is very convenient!
now that docker image builds are automated, the next step is to automate the deployment of these builds. this can be done using docker hub webhooks  and nirmata. nirmata is a saas for deployment and operation of application containers. to trigger automated deployments of your application follow these steps.
- log in to nirmata and create a blueprint for your application.
- add your cloud resources (vms) to nirmata. these resources will be used to deploy your application containers.
- deploy your application to an environment. environment is the runtime instantiation of your application and contains your running application containers
- now, go to docker hub and add webhooks for your image repositories that should trigger automated deploys. the url is displayed below:
you can find the tenant-id on the settings->account page in nirmata web interface.
thats it! you have now setup an automated deployment pipeline. whenever a change is committed to your github repository, a docker image will be automatically build and deployed to your running environment in nirmata. complete operation may take a few minutes depending on how long it takes to build the container image as well as your update policy settings  in nirmata.
nirmata provides an option to automatically deploy new docker images, or simply create a notification when a new image is available so that it can be manually deployed. in case your application contains multiple containers running the same image, then a rolling upgrade is performed based on preconfigured policy settings so that downtime is minimized.
while this level of automation is great, there are several other capabilities needed to achieve the level of automation companies such as netflix have built. at nirmata, our mission is to bring these capabilities to our customers to help them achieve the software devops agility they need to be successful. stay tuned for more exciting features we will be announcing!
vp products, nirmata
follow us: @nirmatacloud
 from code to monkeys: continuous delivery at netflix –
 automated builds on docker hub – https://docs.docker.com/docker-hub/builds/
 docker hub webhooks – https://docs.docker.com/docker-hub/builds/#webhooks
 nirmata update policy – http://help.nirmata.com/en/latest/environments.html#edit-update-policy
Published at DZone with permission of Jim Bugwadia, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.