]> git.immae.eu Git - github/fretlink/docker-ansible.git/commitdiff
Add: a simplest working example.
authorWilliam Yeh <william.pjyeh@gmail.com>
Wed, 29 Apr 2015 03:49:55 +0000 (11:49 +0800)
committerWilliam Yeh <william.pjyeh@gmail.com>
Wed, 29 Apr 2015 03:49:55 +0000 (11:49 +0800)
README.md
compare-image-size.sh [new file with mode: 0755]

index 62d511944b8a1277e499f94c8033cfc32cc1569c..e1e8401204f726cb6aaafd410d4a42207044c96b 100644 (file)
--- a/README.md
+++ b/README.md
@@ -42,6 +42,36 @@ These are Docker images for [Ansible](https://github.com/ansible/ansible) softwa
   - `williamyeh/ansible:centos6-onbuild`
 
 
+## For the impatient
+
+Here comes a simplest working example for the impatient.
+
+First, choose a base image you'd like to begin with. For example, `williamyeh/ansible:ubuntu14.04-onbuild`.
+
+Second, put the following `Dockerfile` along with your playbook directory:
+
+```
+FROM williamyeh/ansible:ubuntu14.04-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
+```
+
+Third, `docker build .`
+
+Done!
+
+For more advanced usage, the role in Ansible Galaxy [`williamyeh/nginx`](https://github.com/William-Yeh/ansible-nginx) also demonstrates how to do a simple integration test on [Travis CI](https://travis-ci.org/).
+
+
+
+
 ## Why yet another Ansible image for Docker?
 
 There has been quite a few Ansible images for Docker (e.g., [search](https://registry.hub.docker.com/search?q=ansible) in the Docker Hub), so why reinvent the wheel?
@@ -55,11 +85,28 @@ In the beginning I used the [`ansible/ansible-docker-base`](https://github.com/a
 Therefore, I built these Docker images on my own.
 
 
+### Comparison: image size
+
+```
+REPOSITORY                    TAG                   VIRTUAL SIZE
+---------------------------   -------------------   ------------
+ansible/centos7-ansible       stable                367.5 MB
+ansible/ubuntu14.04-ansible   stable                286.6 MB
+
+williamyeh/ansible            centos6-onbuild       264.2 MB
+williamyeh/ansible            centos7-onbuild       275.3 MB
+williamyeh/ansible            debian7-onbuild       134.4 MB
+williamyeh/ansible            debian8-onbuild       178.3 MB
+williamyeh/ansible            ubuntu12.04-onbuild   181.9 MB
+williamyeh/ansible            ubuntu14.04-onbuild   238.3 MB
+```
+
+
 ## Usage
 
 Used mostly as a *base image* for configuring, with Ansible, other software stack on some specified Linux distribution.
 
-Take Debian/Ubuntu for example. To test an Ansible `playbook.yml` against a variety of Linux distributions, we may use [Vagrant](https://www.vagrantup.com/) as follows:
+Take Debian/Ubuntu/CentOS for example. To test an Ansible `playbook.yml` against a variety of Linux distributions, we may use [Vagrant](https://www.vagrantup.com/) as follows:
 
 ```ruby
 # Vagrantfile
diff --git a/compare-image-size.sh b/compare-image-size.sh
new file mode 100755 (executable)
index 0000000..9c7c5cd
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+
+declare -a IMAGES=( 'ansible/ubuntu14.04-ansible:stable' 'ansible/centos7-ansible:stable'  \
+         "williamyeh/ansible:debian8-onbuild"        \
+         "williamyeh/ansible:debian7-onbuild"        \
+         "williamyeh/ansible:ubuntu14.04-onbuild"    \
+         "williamyeh/ansible:ubuntu12.04-onbuild"    \
+         "williamyeh/ansible:centos7-onbuild"        \
+         "williamyeh/ansible:centos6-onbuild"
+       )
+
+for image in "${IMAGES[@]}" ; do
+
+    echo $image
+    docker pull $image
+
+done
+
+
+docker images | sort
\ No newline at end of file