- docker build -t ansible_wheezy debian7
- docker build -t ansible_centos7 centos7
- docker build -t ansible_centos6 centos6
+ - docker build -t ansible_alpine3 alpine3
- docker build -t ansible_trusty_onbuild ubuntu14.04-onbuild
- docker build -t ansible_precise_onbuild ubuntu12.04-onbuild
- docker build -t ansible_wheezy_onbuild debian7-onbuild
- docker build -t ansible_centos7_onbuild centos7-onbuild
- docker build -t ansible_centos6_onbuild centos6-onbuild
+ - docker build -t ansible_alpine3_onbuild alpine3-onbuild
script:
- docker run -i ansible_trusty > result-ubuntu14.04
- docker run -i ansible_wheezy > result-debian7
- docker run -i ansible_centos7 > result-centos7
- docker run -i ansible_centos6 > result-centos6
+ - docker run -i ansible_alpine3 > result-alpine3
- docker run -i ansible_trusty_onbuild > result-ubuntu14.04-onbuild
- docker run -i ansible_precise_onbuild > result-ubuntu12.04-onbuild
- docker run -i ansible_jessie_onbuild > result-debian8-onbuild
- docker run -i ansible_wheezy_onbuild > result-debian7-onbuild
- docker run -i ansible_centos7_onbuild > result-centos7-onbuild
- docker run -i ansible_centos6_onbuild > result-centos6-onbuild
+ - docker run -i ansible_alpine3_onbuild > result-alpine3-onbuild
- echo "==> Validating the test results..."
- sh -c "[ -s result-ubuntu14.04 ]"
- sh -c "[ -s result-debian7 ]"
- sh -c "[ -s result-centos7 ]"
- sh -c "[ -s result-centos6 ]"
+ - sh -c "[ -s result-alpine3 ]"
- sh -c "[ -s result-ubuntu14.04-onbuild ]"
- sh -c "[ -s result-ubuntu12.04-onbuild ]"
- sh -c "[ -s result-debian8-onbuild ]"
- sh -c "[ -s result-debian7-onbuild ]"
- sh -c "[ -s result-centos7-onbuild ]"
- sh -c "[ -s result-centos6-onbuild ]"
+ - sh -c "[ -s result-alpine3-onbuild ]"
These are Docker images for [Ansible](https://github.com/ansible/ansible) software, installed in a selected Linux distributions.
-- OS: Debian (jessie, wheezy), Ubuntu (trusty, precise), CentOS (7, 6)
+- OS: Debian (jessie, wheezy), Ubuntu (trusty, precise), CentOS (7, 6), Alpine (3).
- Ansible: usually the latest version (I didn't pin any specific version).
- `williamyeh/ansible:ubuntu12.04`
- `williamyeh/ansible:centos7`
- `williamyeh/ansible:centos6`
+ - `williamyeh/ansible:alpine3`
- Onbuild series:
- `williamyeh/ansible:ubuntu12.04-onbuild`
- `williamyeh/ansible:centos7-onbuild`
- `williamyeh/ansible:centos6-onbuild`
+ - `williamyeh/ansible:alpine3-onbuild`
## For the impatient
ansible/centos7-ansible stable 367.5 MB
ansible/ubuntu14.04-ansible stable 286.6 MB
+williamyeh/ansible alpine3-onbuild 66.4 MB
williamyeh/ansible centos6-onbuild 264.2 MB
williamyeh/ansible centos7-onbuild 275.3 MB
williamyeh/ansible debian7-onbuild 134.4 MB
# ==> Choose a Vagrant box to emulate Linux distribution...
config.vm.box = "ubuntu/trusty64"
- #config.vm.box = "hashicorp/precise64"
- #config.vm.box = "chef/debian-7.8"
- #config.vm.box = "chef/centos-7.0"
- #config.vm.box = "chef/centos-6.6"
+ #config.vm.box = "ubuntu/precise64"
+ #config.vm.box = "debian/jessie64"
+ #config.vm.box = "debian/wheezy64"
+ #config.vm.box = "bento/centos-7.1"
+ #config.vm.box = "bento/centos-6.7"
+ #config.vm.box = "maier/alpine-3.1.3-x86_64"
# ==> Executing Ansible...
#FROM williamyeh/ansible:debian7
#FROM williamyeh/ansible:centos7
#FROM williamyeh/ansible:centos6
+#FROM williamyeh/ansible:alpine3
# ==> Copying Ansible playbook...
#FROM williamyeh/ansible:debian7-onbuild
#FROM williamyeh/ansible:centos7-onbuild
#FROM williamyeh/ansible:centos6-onbuild
+#FROM williamyeh/ansible:alpine3-onbuild
# ==> Specify requirements filename; default = "requirements.yml"
docker build -t ansible:debian7 debian7
docker build -t ansible:centos7 centos7
docker build -t ansible:centos6 centos6
+ docker build -t ansible:alpine3 alpine3
docker build -t ansible:ubuntu14.04-onbuild ubuntu14.04-onbuild
docker build -t ansible:ubuntu12.04-onbuild ubuntu12.04-onbuild
docker build -t ansible:debian7-onbuild debian7-onbuild
docker build -t ansible:centos7-onbuild centos7-onbuild
docker build -t ansible:centos6-onbuild centos6-onbuild
+ docker build -t ansible:alpine3-onbuild alpine3-onbuild
SHELL
end
--- /dev/null
+# Dockerfile for building Ansible image for Alpine 3, with as few additional software as possible.
+#
+# @see https://github.com/gliderlabs/docker-alpine/blob/master/docs/usage.md
+#
+# Version 1.0
+#
+
+
+# pull base image
+FROM alpine:3.2
+
+MAINTAINER William Yeh <william.pjyeh@gmail.com>
+
+
+RUN echo "===> Adding Python runtime..." && \
+ apk --update add python py-pip openssl ca-certificates && \
+ apk --update add --virtual build-dependencies python-dev build-base && \
+ pip install --upgrade pip && \
+ \
+ \
+ echo "===> Installing Ansible..." && \
+ pip install ansible && \
+ \
+ \
+ echo "===> Removing package list..." && \
+ apk del build-dependencies && \
+ rm -rf /var/cache/apk/* && \
+ \
+ \
+ echo "===> Adding hosts for convenience..." && \
+ mkdir -p /etc/ansible && \
+ echo '[local]\nlocalhost\n' > /etc/ansible/hosts
+
+
+COPY ansible-playbook-wrapper /usr/local/bin/
+
+
+ONBUILD WORKDIR /tmp
+ONBUILD COPY . /tmp
+ONBUILD RUN \
+ echo "===> Diagnosis: host information..." && \
+ ansible -c local -m setup all
+
+
+
+# default command: display Ansible version
+CMD [ "ansible-playbook", "--version" ]
--- /dev/null
+#!/bin/sh
+#
+# Simple wrapper for executing ansible-galaxy and ansible-playbook
+# with local connection.
+#
+# USAGE:
+# ansible-playbook-wrapper [other ansible-playbook arguments]
+#
+# ENVIRONMENT VARIABLES:
+#
+# - REQUIREMENTS: requirements filename; default = "requirements.yml"
+# - PLAYBOOK: playbook filename; default = "playbook.yml"
+# - INVENTORY: inventory filename; default = "/etc/ansible/hosts"
+#
+
+
+#
+# install Galaxy roles, if any
+#
+
+if [ -z "$REQUIREMENTS" ]; then
+ REQUIREMENTS=requirements.yml
+fi
+
+if [ -f "$REQUIREMENTS" ]; then
+ ansible-galaxy install -r $REQUIREMENTS
+fi
+
+
+#
+# execute playbook
+#
+
+if [ -z "$PLAYBOOK" ]; then
+ PLAYBOOK=playbook.yml
+fi
+
+
+if [ -z "$INVENTORY" ]; then
+ exec ansible-playbook \
+ $PLAYBOOK \
+ --connection=local \
+ "$@"
+else
+ exec ansible-playbook \
+ -i $INVENTORY $PLAYBOOK \
+ --connection=local \
+ "$@"
+fi
--- /dev/null
+# Dockerfile for building Ansible image for Alpine 3, with as few additional software as possible.
+#
+# @see https://github.com/gliderlabs/docker-alpine/blob/master/docs/usage.md
+#
+# Version 1.0
+#
+
+
+# pull base image
+FROM alpine:3.2
+
+MAINTAINER William Yeh <william.pjyeh@gmail.com>
+
+
+RUN echo "===> Adding Python runtime..." && \
+ apk --update add python py-pip openssl ca-certificates && \
+ apk --update add --virtual build-dependencies python-dev build-base && \
+ pip install --upgrade pip && \
+ \
+ \
+ echo "===> Installing Ansible..." && \
+ pip install ansible && \
+ \
+ \
+ echo "===> Removing package list..." && \
+ apk del build-dependencies && \
+ rm -rf /var/cache/apk/* && \
+ \
+ \
+ echo "===> Adding hosts for convenience..." && \
+ mkdir -p /etc/ansible && \
+ echo '[local]\nlocalhost\n' > /etc/ansible/hosts
+
+
+# default command: display Ansible version
+CMD [ "ansible-playbook", "--version" ]
- docker build -t ansible_wheezy debian7
- docker build -t ansible_centos7 centos7
- docker build -t ansible_centos6 centos6
+ - docker build -t ansible_alpine3 alpine3
- docker build -t ansible_trusty_onbuild ubuntu14.04-onbuild
- docker build -t ansible_precise_onbuild ubuntu12.04-onbuild
- docker build -t ansible_wheezy_onbuild debian7-onbuild
- docker build -t ansible_centos7_onbuild centos7-onbuild
- docker build -t ansible_centos6_onbuild centos6-onbuild
+ - docker build -t ansible_alpine3_onbuild alpine3-onbuild
test:
override:
- docker run -i ansible_wheezy > result-debian7
- docker run -i ansible_centos7 > result-centos7
- docker run -i ansible_centos6 > result-centos6
+ - docker run -i ansible_alpine3 > result-alpine3
- docker run -i ansible_trusty_onbuild > result-ubuntu14.04-onbuild
- docker run -i ansible_precise_onbuild > result-ubuntu12.04-onbuild
- docker run -i ansible_jessie_onbuild > result-debian8-onbuild
- docker run -i ansible_wheezy_onbuild > result-debian7-onbuild
- docker run -i ansible_centos7_onbuild > result-centos7-onbuild
- docker run -i ansible_centos6_onbuild > result-centos6-onbuild
+ - docker run -i ansible_alpine3_onbuild > result-alpine3-onbuild
- echo "==> Validating the test results..."
- sh -c "[ -s result-ubuntu14.04 ]"
- sh -c "[ -s result-debian7 ]"
- sh -c "[ -s result-centos7 ]"
- sh -c "[ -s result-centos6 ]"
+ - sh -c "[ -s result-alpine3 ]"
- sh -c "[ -s result-ubuntu14.04-onbuild ]"
- sh -c "[ -s result-ubuntu12.04-onbuild ]"
- sh -c "[ -s result-debian8-onbuild ]"
- sh -c "[ -s result-debian7-onbuild ]"
- sh -c "[ -s result-centos7-onbuild ]"
- sh -c "[ -s result-centos6-onbuild ]"
+ - sh -c "[ -s result-alpine3-onbuild ]"