From ebfd2bf236ddaf7206dc77877dc9eb2d07a0dec9 Mon Sep 17 00:00:00 2001 From: William Yeh Date: Tue, 28 Apr 2015 12:21:34 +0800 Subject: Add: onbuild and debian8. --- README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index c303044..7dce9f8 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,27 @@ This repository contains Dockerized [Ansible](https://github.com/ansible/ansible These are Docker images for [Ansible](https://github.com/ansible/ansible) software, installed in a selected Linux distributions. -- OS: Debian (wheezy), Ubuntu (precise, trusty). +- OS: Debian (jessie, wheezy), Ubuntu (trusty, precise). - Ansible: usually the latest version. +## Images and tags + +- normal series: + + - `williamyeh/ansible:debian8` + - `williamyeh/ansible:debian7` + - `williamyeh/ansible:ubuntu14.04` + - `williamyeh/ansible:ubuntu12.04` + +- onbuild series: + + - `williamyeh/ansible:debian8-onbuild` + - `williamyeh/ansible:debian7-onbuild` + - `williamyeh/ansible:ubuntu14.04-onbuild` + - `williamyeh/ansible:ubuntu12.04-onbuild` + ## Why yet another Ansible image for Docker? @@ -57,7 +73,8 @@ Vagrant.configure(2) do |config| end ``` -Virtual machines can emulate a variety of Linux distributions, at the cost of runtime overhead. +Virtual machines can emulate a variety of Linux distributions with good quality, at the cost of runtime overhead. + Docker to be a rescue. Now, with these **williamyeh/ansible** series, we may test an Ansible `playbook.yml` against a variety of Linux distributions as follows: @@ -68,8 +85,10 @@ Docker to be a rescue. Now, with these **williamyeh/ansible** series, we may tes # ==> Choose a base image to emulate Linux distribution... FROM williamyeh/ansible:ubuntu14.04 #FROM williamyeh/ansible:ubuntu12.04 +#FROM williamyeh/ansible:debian8 #FROM williamyeh/ansible:debian7 + # ==> Copying Ansible playbook... WORKDIR /tmp COPY . /tmp @@ -82,8 +101,34 @@ RUN ansible-playbook -i inventory playbook.yml \ --connection=local --sudo ``` +Or, more simple with `onbuild` series: + +```dockerfile +# Dockerfile + +# ==> Choose a base image to emulate Linux distribution... +FROM williamyeh/ansible:ubuntu14.04-onbuild +#FROM williamyeh/ansible:ubuntu12.04-onbuild +#FROM williamyeh/ansible:debian8-onbuild +#FROM williamyeh/ansible:debian7-onbuild + + +# ==> Specify playbook filename; default = "playbook.yml" +#ENV PLAYBOOK playbook.yml + +# ==> Specify inventory filename; default = "/etc/ansible/hosts" +#ENV INVENTORY inventory.ini + +# ==> Executing Ansible... +RUN ansible-playbook-wrapper +``` + + + With Docker, we can test any Ansible playbook against any version of any Linux distribution without the help of Vagrant. More lightweight, and more portable across IaaS, PaaS, and even CaaS (Container as a Service) providers! +If better OS emulation (virtualization) isn't required, the Docker approach (containerization) should give you a more efficient Ansible experience. + ## License -- cgit v1.2.3