background preloader

With docker

Facebook Twitter

.. seems toe be a significant traction in this direction .. and there are docker oriented modules now in ansible core .. good place to focus

How Ansible & Docker fit: Using Ansible to bootstrap & coordinate Docker containers - Recursivity. September 8, 2014 in docker, ansible, infrastructure, automation There are a lot of exciting tools in the infrastructure & virtualisation space that have emerged in the last couple of years. Ansible & Docker are probably two of the most exciting ones in my opinion. While I’ve already used Ansible extensively, I’ve only started to use Docker, so that’s the big caveat emptor with regards to the contents of this post. What’s Docker & why should I care?

Docker describes itself as a “container platform”, which at a first glance can be easily confused with a VM. Docker uses resource isolation features of the Linux kernel such as cgroups and kernel namespaces to allow independent "containers" to run within a single Linux instance, avoiding the overhead of starting virtual machines. My take on where Docker is useful and not useful: 1. Docker is useful as a container for distinct processes or groups of processes that make up an application.

Docker as an app container 2. 3. 1. [local] localhost 2. Installing and Building Docker With Ansible. There's been a lot of interest in using Ansible and Docker together recently, so I thought it might be nice to highlight a few tricks. First off, installing Docker. If you have an Ansible installation, Paul Durivage has written a rather brilliant role for installing Docker on a Ubuntu host that is quite easier, even in internal implementation, than the official install instructions. If we start from Ubuntu 13.10 and just run Ansible from it's development branch without installation, steps look as follows: apt-get update apt-get install git python-yaml python-jinja2 python-pycurl git clone cd ansible source .

From there, we can use the docker_ubuntu role that Paul has uploaded onto Galaxy, so we'll download it with a simple CLI call: ansible-galaxy install angstwad.docker_ubuntu And write a simple playbook to use it by creating a stub inventory file in /etc/ansible/hosts: [local] localhost And a very simple playbook to call it, /tmp/docker.yml: Related News. And Docker. Docker is an exciting new open source technology that promises to "help developers build and ship higher quality apps faster" and sysadmins "to deploy and run any app on any infrastructure, quickly and reliably" (source: But to truly leverage the power of Docker, you need an orchestration tool that can help you provision, deploy and manage your servers with Docker running on them - and help you build Docker-files themselves, in the simplest way possible.

Installing & Building Docker with Ansible - Michael DeHaan, Founder of the Ansible project "To me the interesting part is how to use Ansible to build docker-files, in the simplest way possible. One of the things we've always preferred is to have portable descriptions of automation, and to also get to something more efficient to develop than bash. " "One of the more logical things to do is to use Docker to distribute your containers, which can be done with the docker module in Ansible core.

" Ansible-docker-base/README.md at master · ansible/ansible-docker-base. Ansible/ansible-docker-base. Ansible/ubuntu14.04-ansible Repository. These are base docker images that include ansible. Ansible maintains these images so that people can easily build docker images using ansible playbooks. The images in this repository use ubuntu14.04 as their base. If you'd rather base your image on centos7 , please see: latest, devel (Dockerfile)stable (Dockerfile)$major_version. devel and latest point to an image built with a recent checkout of ansible's development branch. stable is built with the latest ansible release on pypi. The $major. A simple example of using this to build a Docker image using a playbook can be found in the source repository: If you are using a docker hub automated build to build your images you can set your image to rebuild whenever the base ansible image is updated:

Veggiemonk/awesome-docker. Docker: Containers for the Masses -- Ansible and Docker. Welcome again to the series "Docker: Containers for the Masses". Today's post will be the fourth in this series and will concern itself with management of Docker using Ansible For the reader just joining, the previous three posts in this series are: Introduction -- Introduction to DockerInstallation -- Installation of Docker Using Docker -- Using Docker With the basics of Docker having been presented, the following blog posts will cover more advanced usage-cases for Docker as well as complimentary and related projects. As mentioned before, I have had the pleasure of working with both Docker and Ansible and realized there were some features in Ansible related to Docker that I wanted to familiarize myself with and take advantage of.

This first post will familiarize the reader to what Ansible is, its modular design, and introduce a simple Ansible playbook. Ansible There is a good chance that readers of this blog post know what Ansible is and they can skip ahead two sections. Ansible Basics. Vagrant, Docker and Ansible. WTF? | devo.ps. Given that we're building a SaaS that helps our client managing their infrastructure, our team is pretty familiar with leveraging VMs and configuration management tools.

We've actually been heavy users of Vagrant and Ansible for the past year, and it's helped us tremendously normalize our development process. As our platform grew in complexity, some additional needs emerged: Containerization; we needed to be able to safely execute custom, and potentially harmful, code.Weight; as we added more sub-systems to devo.ps, having full blown VMs proved to be hard to juggle with when testing and developing.

And that's why we ended up adding Docker to our development workflow. We were already familiar with it (as it powers some parts of the devo.ps infrastructure) and knew there would be obvious wins. Let's get started. Vagrant You've probably heard about Vagrant; a healthy number of people have been writing about it in the past 6 months. A few interesting features: Docker Ansible Let's get to work. Ansible & Docker - The Path to Continuous Delivery I. If I had a Rails application requiring MySQL and Redis that I wanted to host myself, this is the quickest and most simple approach. There are just 2 dependencies: Ansible & Docker. To make the introductions: Meet Ansible, a system orchestration tool. It has no dependencies other than python and ssh.

It doesn’t require any agents to be set up on the remote hosts and it doesn’t leave any traces after it runs either. What’s more, it comes with an extensive, built-in library of modules for controlling everything from package managers to cloud providers, to databases and everything else in between. Meet Docker, a utility for creating virtualized Linux containers for shipping self-contained applications. The quickest way to setup Ansible on OS X: sudo easy_install pip sudo pip install setuptools ansible Ansible will setup Docker on the remote system, there’s only 1 thing left to do on my local system: setup DigitalOcean integration. Bin/ap create_droplet.yml hosts -c local bin/ap dod.yml dohosts.

I wish that Ansible would work with orchestrating Docker containers. Here's my. I wish that Ansible would work with orchestrating Docker containers. Here's my thought - Docker is replacing the use case for using Ansible/Chef/Puppet for a lot of people. It is far too easy to build portable docker machines and deploy them on bare metal. For me, the use case of provisioning a softlayer server and then setting it up using Ansible/Chef is no longer present. However, the problem of orchestrating a bunch of Docker machines is still unsolved. So, if I want to launch a hadoop cluster over 20 Docker VMs, physically hosted in 5 different servers... I'm not sure if Chef is more suited to this, given that Octohost moved from Ansible to chef for a Docker PAAS [2], but I would definitely love for Ansible to do this part really well !

[1] Docker_image - manage docker images. Docker - manage docker containers. The Why and How of Ansible and Docker - The Changelog. This is a guest post by Gerhard Lazu, a Rubyist with a strong devops background. It originally appeared here on The Changelog #. There is a lot of interest from the tech community in both Docker and Ansible, I am hoping that after reading this article you will share our enthusiasm. You will also gain a practical insight into using Ansible and Docker for setting up a complete server environment for a Rails application.

Many reading this might be asking, “Why don’t you just use Heroku?”. First of all, I can run Docker and Ansible on any host, with any provider. Why Ansible? After 4 years of heavy Chef usage, the infrastructure as code mentality becomes really tedious. Ansible has no dependencies other than Python and SSH. Why Docker? Docker is establishing itself as the most reliable and convenient way of deploying a process on a host. A common but understandable mistake is to treat a Docker container as a VM. The Setup Ansible runs all remote commands via SSH. Conclusion. Docker Misconceptions. Docker has hit the systems scene with great fanfare. It's a very exciting advancement for systems, but there are some key misunderstandings around it. Narrowly focused advice! My discussion of Docker is nearly entirely limited to multi-host setups of mission-critical systems (web services primarily).

Please keep that in mind since my coverage and advice will probably not apply to the many other scenarios you can use Docker for. Background on Docker This post assumes a basic understanding of what Docker is and how it works generally. It's beyond the scope of this article to give a full coverage of Docker, so if you're totally new to Docker, first go through these resources before continuing: What is Docker? Docker Basics Misconceptions Docker is an amazing tool for many scenarios, but there are several misconceptions I see come up regularly about using Docker. Misconception: If I learn Docker then I don't have to learn the other systems stuff! Someday this may be true. This is partially true.

Dev Envs Specific

View Public Profile. Ansible-docker-base/examples/webserver-simple at master · ansible/ansible-docker-base. Are Docker Users Migrating to Ansible and Away from Puppet and Chef? Docker is a natural addition to the DevOps tooling movement, occupying mindshare with orchestration technologies like Chef and Puppet. Visit the the Docker registry and search for “Chef” images: at the time of this writing, there were 80 repositories created by 57 users. Searching for “Puppet” yields almost as many: 57 repositories uploaded by 41 users. The investment community believes in the long term potential of these technologies, with VCs investment of over $85 million into Puppet Labs (with a recent $40 million investment in June) and almost $65 million into Chef (formerly OpsCode).

There is another popular orchestration tool: Ansible. The Ansible automation technology is different from Chef and Puppet. It operates strictly over SSH and requires no server side daemon process. Ansible as a technology does not have the massive backing behind it that these other companies do (Ansible has raised only $6 million raised so far). The New Stack Analysis of the Docker Community Interests? View Public Profile. Search · ansible docker. Official Ansible Content on Docker Hub.

Ansible and Docker.