smaller images

This commit is contained in:
Paul Voss 2016-08-14 19:03:43 +02:00
parent f1e45909d9
commit ccc2f2c857
4 changed files with 13 additions and 11 deletions

View File

@ -1,7 +1,8 @@
# ansible # ansible
Docker images for running and testing ansible playbooks against various operating systems. Docker images for running and testing ansible playbooks with various operating systems.
I don't like obfuscated docker images with external scripts and hundreds of bells and whistles.
I don't like obfuscated Dockerfiles with external scripts and hundreds of bells and whistles, so I created these simple ones.
Available operating systems: Available operating systems:
@ -11,7 +12,7 @@ Available operating systems:
* fedora-24 * fedora-24
* ubuntu-16.04 * ubuntu-16.04
## run ansible as controller ## use the ansible image for playbooks
docker run -it --rm \ docker run -it --rm \
-w /site \ -w /site \
@ -23,21 +24,20 @@ Available operating systems:
Note: /root/.ansible must not be an overlayfs, otherwise ssh accelerate won't work. Note: /root/.ansible must not be an overlayfs, otherwise ssh accelerate won't work.
## use ansible in drone builds ## use the ansible image in drone builds
build: build:
image: chmuul/ansible:$$OS image: chmuul/ansible:$$OS
pull: true
commands: commands:
- ansible-playbook -i tests/inventory tests/main.yml --syntax-check - ansible-playbook -i tests/inventory tests/main.yml --syntax-check
- ansible-playbook -i tests/inventory tests/main.yml - ansible-playbook -i tests/inventory tests/main.yml
matrix: matrix:
OS: OS:
- ubuntu-16.04 - centos-7
- fedora-24
- debian-8 - debian-8
- fedora-24
- ubuntu-16.04
## references ## references

View File

@ -1,6 +1,8 @@
FROM centos:7 FROM centos:7
RUN rpm -iU https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm \ RUN rpm -iU https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm \
&& yum -y install ansible && yum -y install ansible \
&& yum clean headers \
&& yum clean packages
CMD ["ansible-playbook", "--help"] CMD ["ansible-playbook", "--help"]

View File

@ -8,7 +8,7 @@ RUN apt-get -q update \
python \ python \
python-dev \ python-dev \
python-pip \ python-pip \
&& apt-get autoclean \ && apt-get clean \
&& pip install --quiet --upgrade \ && pip install --quiet --upgrade \
ansible ansible

View File

@ -7,6 +7,6 @@ RUN apt-get update \
&& apt-get update \ && apt-get update \
&& apt-get install -y --no-install-recommends \ && apt-get install -y --no-install-recommends \
ansible \ ansible \
&& apt-get autoclean && apt-get clean
CMD ["ansible-playbook", "--help"] CMD ["ansible-playbook", "--help"]