fi
if [ -f "$REQUIREMENTS" ]; then
+ apk --update add git
ansible-galaxy install -r $REQUIREMENTS
fi
pip install ansible==1.9.4 && \
\
\
+ echo "===> Installing handy tools (not absolutely required)..." && \
+ apk --update add sshpass openssh-client && \
+ \
+ \
echo "===> Removing package list..." && \
apk del build-dependencies && \
rm -rf /var/cache/apk/* && \
fi
if [ -f "$REQUIREMENTS" ]; then
+ yum -y install git
ansible-galaxy install -r $REQUIREMENTS
fi
sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers || true && \
\
\
+ echo "===> Installing handy tools (not absolutely required)..." && \
+ yum -y install sshpass openssh-clients && \
+ \
+ \
echo "===> Removing unused YUM resources..." && \
yum -y remove epel-release && \
yum clean all && \
fi
if [ -f "$REQUIREMENTS" ]; then
+ yum -y install git
ansible-galaxy install -r $REQUIREMENTS
fi
sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers || true && \
\
\
+ echo "===> Installing handy tools (not absolutely required)..." && \
+ yum -y install sshpass openssh-clients && \
+ \
+ \
echo "===> Removing unused YUM resources..." && \
yum -y remove epel-release && \
yum clean all && \
fi
if [ -f "$REQUIREMENTS" ]; then
+ apt-get install -y git
ansible-galaxy install -r $REQUIREMENTS
fi
pip install ansible==1.9.4 && \
\
\
+ echo "===> Installing handy tools (not absolutely required)..." && \
+ apt-get install -y sshpass openssh-client && \
+ \
+ \
echo "===> Removing unused APT resources..." && \
apt-get -f -y --auto-remove remove \
gcc python-pip python-dev libffi-dev libssl-dev && \
fi
if [ -f "$REQUIREMENTS" ]; then
+ apt-get install -y git
ansible-galaxy install -r $REQUIREMENTS
fi
pip install ansible==1.9.4 && \
\
\
+ echo "===> Installing handy tools (not absolutely required)..." && \
+ apt-get install -y sshpass openssh-client && \
+ \
+ \
echo "===> Removing unused APT resources..." && \
apt-get -f -y --auto-remove remove \
gcc python-pip python-dev libffi-dev libssl-dev && \
fi
if [ -f "$REQUIREMENTS" ]; then
+ apt-get install -y git
ansible-galaxy install -r $REQUIREMENTS
fi
apt-get install -y ansible sudo && \
\
\
+ echo "===> Installing handy tools (not absolutely required)..." && \
+ apt-get install -y sshpass openssh-client && \
+ \
+ \
echo "===> Removing Ansible PPA..." && \
rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/ansible.list && \
\
fi
if [ -f "$REQUIREMENTS" ]; then
+ apt-get install -y git
ansible-galaxy install -r $REQUIREMENTS
fi
apt-get install -y ansible && \
\
\
+ echo "===> Installing handy tools (not absolutely required)..." && \
+ apt-get install -y sshpass openssh-client && \
+ \
+ \
echo "===> Removing Ansible PPA..." && \
rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/ansible.list && \
\
## Summary
-Repository name in Docker Hub: **[williamyeh/ansible](https://registry.hub.docker.com/u/williamyeh/ansible/)**
+Repository name in Docker Hub: **[williamyeh/ansible](https://hub.docker.com/r/williamyeh/ansible/)**
-This repository contains Dockerized [Ansible](https://github.com/ansible/ansible), published to the public [Docker Hub](https://registry.hub.docker.com/) via **automated build** mechanism.
+This repository contains Dockerized [Ansible](https://github.com/ansible/ansible), published to the public [Docker Hub](https://hub.docker.com/) via **automated build** mechanism.
- OS: Debian (jessie, wheezy), Ubuntu (xenial, trusty, precise), CentOS (7, 6), Alpine (3).
-- Ansible: four variants -
+- Ansible: four versions -
1. provides the most recent *stable* version of Ansible; suitable for most people.
- 2. this variant is designed for building *minimal* images out of playbooks; i.e., the Ansible body will be removed when mission completed.
+ 2. same as stable version, but is designed for building *minimal* images out of playbooks; i.e., the Ansible body will be removed when mission completed.
3. provides the old 1.9 version of Ansible.
- 4. provides the *experimental* version of Ansible.
+ 4. provides the *experimental* version of Ansible; i.e., the master branch of git.
+
+
+Each version is further divided into two variants:
+
+- Normal variant: intended to be used as Ansible *control machines*, or in cases that is unsuitable in the onbuild variants.
+- Onbuild variant: intended to be used to build Docker images.
## Images and tags
### Stable version (installed from official PyPI repo):
-- Normal series:
+- Normal variants:
- `williamyeh/ansible:debian8`
- `williamyeh/ansible:debian7`
- `williamyeh/ansible:centos6`
- `williamyeh/ansible:alpine3`
-- Onbuild series (*recommended for common cases*):
+- Onbuild variants (*recommended for common cases*):
- `williamyeh/ansible:debian8-onbuild`
- `williamyeh/ansible:debian7-onbuild`
### Minimal configuration (the Ansible body will be removed when mission completed):
-- Onbuild series:
+- Onbuild variants:
- `williamyeh/ansible:mini-alpine3`
- `williamyeh/ansible:mini-debian8`
### Old 1.9 version:
-- Normal series:
+- Normal variants:
- `williamyeh/ansible:1.9-debian8`
- `williamyeh/ansible:1.9-debian7`
- `williamyeh/ansible:1.9-centos6`
- `williamyeh/ansible:1.9-alpine3`
-- Onbuild series (*recommended for common cases*):
+- Onbuild variants (*recommended for common cases*):
- `williamyeh/ansible:1.9-debian8-onbuild`
- `williamyeh/ansible:1.9-debian7-onbuild`
### Experimental version (building directly from the git `master` source tree; use at your own risk!):
-- Normal series:
+- Normal variants:
- `williamyeh/ansible:master-debian8`
- `williamyeh/ansible:master-debian7`
- `williamyeh/ansible:master-centos7`
- `williamyeh/ansible:master-centos6`
-- Onbuild series (*recommended for common cases*):
+- Onbuild variants (*recommended for common cases*):
- `williamyeh/ansible:master-debian8-onbuild`
- `williamyeh/ansible:master-debian7-onbuild`
## 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?
+There has been quite a few Ansible images for Docker (e.g., [search](https://hub.docker.com/search/?q=ansible&isAutomated=0&isOfficial=0&page=1&pullCount=1&starCount=0) in the Docker Hub), so why reinvent the wheel?
In the beginning I used the [`ansible/ansible-docker-base`](https://github.com/ansible/ansible-docker-base) created by Ansible Inc. It worked well, but left some room for improvement:
--connection=local --sudo
```
-You may also work with `onbuild` series, which take care of many routine steps for you:
+You may also work with `onbuild` variants, which take care of many routine steps for you:
```dockerfile
# Dockerfile
fi
if [ -f "$REQUIREMENTS" ]; then
+ apk --update add git
ansible-galaxy install -r $REQUIREMENTS
fi
pip install ansible && \
\
\
+ echo "===> Installing handy tools (not absolutely required)..." && \
+ apk --update add sshpass openssh-client && \
+ \
+ \
echo "===> Removing package list..." && \
apk del build-dependencies && \
rm -rf /var/cache/apk/* && \
fi
if [ -f "$REQUIREMENTS" ]; then
+ yum -y install git
ansible-galaxy install -r $REQUIREMENTS
fi
sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers || true && \
\
\
+ echo "===> Installing handy tools (not absolutely required)..." && \
+ yum -y install sshpass openssh-clients && \
+ \
+ \
echo "===> Removing unused YUM resources..." && \
yum -y remove epel-release && \
yum clean all && \
fi
if [ -f "$REQUIREMENTS" ]; then
+ yum -y install git
ansible-galaxy install -r $REQUIREMENTS
fi
sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers || true && \
\
\
+ echo "===> Installing handy tools (not absolutely required)..." && \
+ yum -y install sshpass openssh-clients && \
+ \
+ \
echo "===> Removing unused YUM resources..." && \
yum -y remove epel-release && \
yum clean all && \
fi
if [ -f "$REQUIREMENTS" ]; then
+ apt-get install -y git
ansible-galaxy install -r $REQUIREMENTS
fi
pip install ansible && \
\
\
+ echo "===> Installing handy tools (not absolutely required)..." && \
+ apt-get install -y sshpass openssh-client && \
+ \
+ \
echo "===> Removing unused APT resources..." && \
apt-get -f -y --auto-remove remove \
gcc python-pip python-dev libffi-dev libssl-dev && \
fi
if [ -f "$REQUIREMENTS" ]; then
+ apt-get install -y git
ansible-galaxy install -r $REQUIREMENTS
fi
pip install ansible && \
\
\
+ echo "===> Installing handy tools (not absolutely required)..." && \
+ apt-get install -y sshpass openssh-client && \
+ \
+ \
echo "===> Removing unused APT resources..." && \
apt-get -f -y --auto-remove remove \
gcc python-pip python-dev libffi-dev libssl-dev && \
fi
if [ -f "$REQUIREMENTS" ]; then
+ yum -y install git
ansible-galaxy install -r $REQUIREMENTS
fi
sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers && \
\
\
+ echo "===> Installing handy tools (not absolutely required)..." && \
+ yum -y install sshpass openssh-clients && \
+ \
+ \
echo "===> Removing unused YUM resources..." && \
yum -y remove epel-release gcc git python-devel python-pip \
libffi-devel openssl-devel || true && \
fi
if [ -f "$REQUIREMENTS" ]; then
+ yum -y install git
ansible-galaxy install -r $REQUIREMENTS
fi
sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers && \
\
\
+ echo "===> Installing handy tools (not absolutely required)..." && \
+ yum -y install sshpass openssh-clients && \
+ \
+ \
echo "===> Removing unused YUM resources..." && \
yum -y remove epel-release gcc git python-devel python-pip \
libffi-devel openssl-devel || true && \
fi
if [ -f "$REQUIREMENTS" ]; then
+ apt-get install -y git
ansible-galaxy install -r $REQUIREMENTS
fi
rm -rf /ansible && \
\
\
+ echo "===> Installing handy tools (not absolutely required)..." && \
+ apt-get install -y sshpass openssh-client && \
+ \
+ \
echo "===> Clean up..." && \
apt-get remove -y --auto-remove \
build-essential python-pip python-dev git libffi-dev libssl-dev && \
fi
if [ -f "$REQUIREMENTS" ]; then
+ apt-get install -y git
ansible-galaxy install -r $REQUIREMENTS
fi
rm -rf /ansible && \
\
\
+ echo "===> Installing handy tools (not absolutely required)..." && \
+ apt-get install -y sshpass openssh-client && \
+ \
+ \
echo "===> Clean up..." && \
apt-get remove -y --auto-remove \
build-essential python-pip python-dev git libffi-dev libssl-dev && \
fi
if [ -f "$REQUIREMENTS" ]; then
+ apt-get install -y git
ansible-galaxy install -r $REQUIREMENTS
fi
rm -rf /ansible && \
\
\
+ echo "===> Installing handy tools (not absolutely required)..." && \
+ apt-get install -y sshpass openssh-client && \
+ \
+ \
echo "===> Clean up..." && \
apt-get remove -y --auto-remove \
build-essential python-pip python-dev git && \
fi
if [ -f "$REQUIREMENTS" ]; then
+ apt-get install -y git
ansible-galaxy install -r $REQUIREMENTS
fi
rm -rf /ansible && \
\
\
+ echo "===> Installing handy tools (not absolutely required)..." && \
+ apt-get install -y sshpass openssh-client && \
+ \
+ \
echo "===> Clean up..." && \
apt-get remove -y --auto-remove \
build-essential python-pip python-dev git && \
fi
if [ -f "$REQUIREMENTS" ]; then
+ apt-get install -y git
ansible-galaxy install -r $REQUIREMENTS
fi
rm -rf /ansible && \
\
\
+ echo "===> Installing handy tools (not absolutely required)..." && \
+ apt-get install -y sshpass openssh-client && \
+ \
+ \
echo "===> Clean up..." && \
apt-get remove -y --auto-remove \
build-essential python-pip python-dev git libffi-dev libssl-dev && \
# build-dependencies
python-dev libffi-dev openssl-dev build-base
+
+# may be required by ansible-galaxy
+git
\ No newline at end of file
#####python-pip python-yaml
# build-dependencies
-#####python-dev libffi-dev libssl-dev
\ No newline at end of file
+#####python-dev libffi-dev libssl-dev
+
+# may be required by ansible-galaxy
+git
\ No newline at end of file
fi
if [ -f "$REQUIREMENTS" ]; then
+ apt-get install -y git
ansible-galaxy install -r $REQUIREMENTS
fi
apt-get install -y ansible sudo && \
\
\
+ echo "===> Installing handy tools (not absolutely required)..." && \
+ apt-get install -y sshpass openssh-client && \
+ \
+ \
echo "===> Removing Ansible PPA..." && \
rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/ansible.list && \
\
fi
if [ -f "$REQUIREMENTS" ]; then
+ apt-get install -y git
ansible-galaxy install -r $REQUIREMENTS
fi
apt-get install -y ansible && \
\
\
+ echo "===> Installing handy tools (not absolutely required)..." && \
+ apt-get install -y sshpass openssh-client && \
+ \
+ \
echo "===> Removing Ansible PPA..." && \
rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/ansible.list && \
\
fi
if [ -f "$REQUIREMENTS" ]; then
+ apt-get install -y git
ansible-galaxy install -r $REQUIREMENTS
fi
apt-get install -y ansible && \
\
\
+ echo "===> Installing handy tools (not absolutely required)..." && \
+ apt-get install -y sshpass openssh-client && \
+ \
+ \
echo "===> Removing Ansible PPA..." && \
rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/ansible.list && \
\