Skip to content

Commit

Permalink
Add: git for onbuild variants; handy tools for others.
Browse files Browse the repository at this point in the history
  • Loading branch information
William-Yeh committed Jun 14, 2016
1 parent d707bce commit b1f3718
Show file tree
Hide file tree
Showing 47 changed files with 137 additions and 15 deletions.
1 change: 1 addition & 0 deletions 1.9-alpine3-onbuild/ansible-playbook-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if [ -z "$REQUIREMENTS" ]; then
fi

if [ -f "$REQUIREMENTS" ]; then
apk --update add git
ansible-galaxy install -r $REQUIREMENTS
fi

Expand Down
4 changes: 4 additions & 0 deletions 1.9-alpine3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ RUN echo "===> Adding Python runtime..." && \
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/* && \
Expand Down
1 change: 1 addition & 0 deletions 1.9-centos6-onbuild/ansible-playbook-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if [ -z "$REQUIREMENTS" ]; then
fi

if [ -f "$REQUIREMENTS" ]; then
yum -y install git
ansible-galaxy install -r $REQUIREMENTS
fi

Expand Down
4 changes: 4 additions & 0 deletions 1.9-centos6/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ RUN echo "===> Installing EPEL..." && \
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 && \
Expand Down
1 change: 1 addition & 0 deletions 1.9-centos7-onbuild/ansible-playbook-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if [ -z "$REQUIREMENTS" ]; then
fi

if [ -f "$REQUIREMENTS" ]; then
yum -y install git
ansible-galaxy install -r $REQUIREMENTS
fi

Expand Down
4 changes: 4 additions & 0 deletions 1.9-centos7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ RUN echo "===> Enabling systemd..." && \
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 && \
Expand Down
1 change: 1 addition & 0 deletions 1.9-debian7-onbuild/ansible-playbook-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if [ -z "$REQUIREMENTS" ]; then
fi

if [ -f "$REQUIREMENTS" ]; then
apt-get install -y git
ansible-galaxy install -r $REQUIREMENTS
fi

Expand Down
4 changes: 4 additions & 0 deletions 1.9-debian7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ RUN echo "===> Installing python, sudo, and supporting tools..." && \
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 && \
Expand Down
1 change: 1 addition & 0 deletions 1.9-debian8-onbuild/ansible-playbook-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if [ -z "$REQUIREMENTS" ]; then
fi

if [ -f "$REQUIREMENTS" ]; then
apt-get install -y git
ansible-galaxy install -r $REQUIREMENTS
fi

Expand Down
4 changes: 4 additions & 0 deletions 1.9-debian8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ RUN echo "===> Installing python, sudo, and supporting tools..." && \
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 && \
Expand Down
1 change: 1 addition & 0 deletions 1.9-ubuntu12.04-onbuild/ansible-playbook-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if [ -z "$REQUIREMENTS" ]; then
fi

if [ -f "$REQUIREMENTS" ]; then
apt-get install -y git
ansible-galaxy install -r $REQUIREMENTS
fi

Expand Down
4 changes: 4 additions & 0 deletions 1.9-ubuntu12.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ RUN echo "===> Adding Ansible's PPA..." && \
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 && \
\
Expand Down
1 change: 1 addition & 0 deletions 1.9-ubuntu14.04-onbuild/ansible-playbook-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if [ -z "$REQUIREMENTS" ]; then
fi

if [ -f "$REQUIREMENTS" ]; then
apt-get install -y git
ansible-galaxy install -r $REQUIREMENTS
fi

Expand Down
4 changes: 4 additions & 0 deletions 1.9-ubuntu14.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ RUN echo "===> Adding Ansible's PPA..." && \
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 && \
\
Expand Down
34 changes: 20 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Docker-Ansible base images

## 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.



Expand All @@ -18,19 +18,25 @@ These are Docker images for [Ansible](https://github.com/ansible/ansible) softwa

- 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`
Expand All @@ -41,7 +47,7 @@ These are Docker images for [Ansible](https://github.com/ansible/ansible) softwa
- `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`
Expand All @@ -55,15 +61,15 @@ These are Docker images for [Ansible](https://github.com/ansible/ansible) softwa

### 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`
Expand All @@ -73,7 +79,7 @@ These are Docker images for [Ansible](https://github.com/ansible/ansible) softwa
- `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`
Expand All @@ -86,7 +92,7 @@ These are Docker images for [Ansible](https://github.com/ansible/ansible) softwa

### 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`
Expand All @@ -96,7 +102,7 @@ These are Docker images for [Ansible](https://github.com/ansible/ansible) softwa
- `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`
Expand Down Expand Up @@ -143,7 +149,7 @@ For more advanced usage, the role in Ansible Galaxy [`williamyeh/nginx`](https:/

## 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:

Expand Down Expand Up @@ -235,7 +241,7 @@ RUN ansible-playbook -i inventory playbook.yml \
--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
Expand Down
1 change: 1 addition & 0 deletions alpine3-onbuild/ansible-playbook-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if [ -z "$REQUIREMENTS" ]; then
fi

if [ -f "$REQUIREMENTS" ]; then
apk --update add git
ansible-galaxy install -r $REQUIREMENTS
fi

Expand Down
4 changes: 4 additions & 0 deletions alpine3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ RUN echo "===> Adding Python runtime..." && \
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/* && \
Expand Down
1 change: 1 addition & 0 deletions centos6-onbuild/ansible-playbook-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if [ -z "$REQUIREMENTS" ]; then
fi

if [ -f "$REQUIREMENTS" ]; then
yum -y install git
ansible-galaxy install -r $REQUIREMENTS
fi

Expand Down
4 changes: 4 additions & 0 deletions centos6/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ RUN echo "===> Installing EPEL..." && \
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 && \
Expand Down
1 change: 1 addition & 0 deletions centos7-onbuild/ansible-playbook-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ if [ -z "$REQUIREMENTS" ]; then
fi

if [ -f "$REQUIREMENTS" ]; then
yum -y install git
ansible-galaxy install -r $REQUIREMENTS
fi

Expand Down
4 changes: 4 additions & 0 deletions centos7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ RUN echo "===> Enabling systemd..." && \
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 && \
Expand Down
1 change: 1 addition & 0 deletions debian7-onbuild/ansible-playbook-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if [ -z "$REQUIREMENTS" ]; then
fi

if [ -f "$REQUIREMENTS" ]; then
apt-get install -y git
ansible-galaxy install -r $REQUIREMENTS
fi

Expand Down
4 changes: 4 additions & 0 deletions debian7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ RUN echo "===> Installing python, sudo, and supporting tools..." && \
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 && \
Expand Down
1 change: 1 addition & 0 deletions debian8-onbuild/ansible-playbook-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if [ -z "$REQUIREMENTS" ]; then
fi

if [ -f "$REQUIREMENTS" ]; then
apt-get install -y git
ansible-galaxy install -r $REQUIREMENTS
fi

Expand Down
4 changes: 4 additions & 0 deletions debian8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ RUN echo "===> Installing python, sudo, and supporting tools..." && \
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 && \
Expand Down
1 change: 1 addition & 0 deletions master-centos6-onbuild/ansible-playbook-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if [ -z "$REQUIREMENTS" ]; then
fi

if [ -f "$REQUIREMENTS" ]; then
yum -y install git
ansible-galaxy install -r $REQUIREMENTS
fi

Expand Down
4 changes: 4 additions & 0 deletions master-centos6/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ RUN echo "===> Installing EPEL..." && \
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 && \
Expand Down
1 change: 1 addition & 0 deletions master-centos7-onbuild/ansible-playbook-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if [ -z "$REQUIREMENTS" ]; then
fi

if [ -f "$REQUIREMENTS" ]; then
yum -y install git
ansible-galaxy install -r $REQUIREMENTS
fi

Expand Down
4 changes: 4 additions & 0 deletions master-centos7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ RUN echo "===> Enabling systemd..." && \
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 && \
Expand Down
1 change: 1 addition & 0 deletions master-debian7-onbuild/ansible-playbook-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if [ -z "$REQUIREMENTS" ]; then
fi

if [ -f "$REQUIREMENTS" ]; then
apt-get install -y git
ansible-galaxy install -r $REQUIREMENTS
fi

Expand Down
4 changes: 4 additions & 0 deletions master-debian7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ RUN echo "===> Adding Ansible's prerequisites..." && \
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 && \
Expand Down
Loading

0 comments on commit b1f3718

Please sign in to comment.