From 97d48efeb67f4f7566752625ad3ce233f31985be Mon Sep 17 00:00:00 2001 From: William Yeh Date: Mon, 9 May 2016 16:34:32 +0800 Subject: Add: support for Ubuntu 16.04 LTS (Xenial). Fix: 1. OS-level packages `libffi-dev` and `libssl-dev`/`openssl-dev` should be installed explicitly since Ansible 2.0.2.0(???). 2. Python package cffi should be installed explicitly since Ansible 2.0.2.0(???). 3. add '--fix-missing' for apt. @see https://github.com/boxcutter/ubuntu/issues/62 @see https://github.com/pyca/cryptography/issues/2280 --- .travis.yml | 12 ++++ 1.9-alpine3-onbuild/Dockerfile | 7 +- 1.9-alpine3/Dockerfile | 7 +- 1.9-centos6-onbuild/Dockerfile | 8 ++- 1.9-centos6/Dockerfile | 8 ++- 1.9-centos7-onbuild/Dockerfile | 8 ++- 1.9-centos7/Dockerfile | 8 ++- 1.9-debian7-onbuild/Dockerfile | 8 ++- 1.9-debian7/Dockerfile | 8 ++- 1.9-debian8-onbuild/Dockerfile | 9 ++- 1.9-debian8/Dockerfile | 9 ++- README.md | 11 +++- Vagrantfile | 2 + alpine3-onbuild/Dockerfile | 7 +- alpine3/Dockerfile | 7 +- centos6-onbuild/Dockerfile | 8 ++- centos6/Dockerfile | 8 ++- centos7-onbuild/Dockerfile | 8 ++- centos7/Dockerfile | 8 ++- circle.yml | 12 ++++ compare-image-size.sh | 1 + debian7-onbuild/Dockerfile | 8 ++- debian7/Dockerfile | 8 ++- debian8-onbuild/Dockerfile | 9 ++- debian8/Dockerfile | 9 ++- master-centos6-onbuild/Dockerfile | 7 +- master-centos6/Dockerfile | 9 +-- master-centos7-onbuild/Dockerfile | 13 ++-- master-centos7/Dockerfile | 13 ++-- master-debian7-onbuild/Dockerfile | 14 ++-- master-debian7/Dockerfile | 14 ++-- master-debian8-onbuild/Dockerfile | 15 +++-- master-debian8/Dockerfile | 15 +++-- master-ubuntu16.04-onbuild/Dockerfile | 77 ++++++++++++++++++++++ .../ansible-playbook-wrapper | 49 ++++++++++++++ master-ubuntu16.04/Dockerfile | 62 +++++++++++++++++ ubuntu16.04-onbuild/Dockerfile | 45 +++++++++++++ ubuntu16.04-onbuild/ansible-playbook-wrapper | 49 ++++++++++++++ ubuntu16.04/Dockerfile | 30 +++++++++ 39 files changed, 505 insertions(+), 105 deletions(-) create mode 100644 master-ubuntu16.04-onbuild/Dockerfile create mode 100755 master-ubuntu16.04-onbuild/ansible-playbook-wrapper create mode 100644 master-ubuntu16.04/Dockerfile create mode 100644 ubuntu16.04-onbuild/Dockerfile create mode 100755 ubuntu16.04-onbuild/ansible-playbook-wrapper create mode 100644 ubuntu16.04/Dockerfile diff --git a/.travis.yml b/.travis.yml index 060b99c..4e5dfcb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ before_install: - docker info - docker version + - docker build -t ansible_xenial ubuntu16.04 - docker build -t ansible_trusty ubuntu14.04 - docker build -t ansible_precise ubuntu12.04 - docker build -t ansible_jessie debian8 @@ -14,6 +15,7 @@ before_install: - docker build -t ansible_centos6 centos6 - docker build -t ansible_alpine3 alpine3 + - docker build -t ansible_xenial_onbuild ubuntu16.04-onbuild - docker build -t ansible_trusty_onbuild ubuntu14.04-onbuild - docker build -t ansible_precise_onbuild ubuntu12.04-onbuild - docker build -t ansible_jessie_onbuild debian8-onbuild @@ -40,6 +42,7 @@ before_install: - docker build -t ansible_1.9_alpine3_onbuild 1.9-alpine3-onbuild + - docker build -t ansible_master_xenial master-ubuntu16.04 - docker build -t ansible_master_trusty master-ubuntu14.04 - docker build -t ansible_master_precise master-ubuntu12.04 - docker build -t ansible_master_jessie master-debian8 @@ -47,6 +50,7 @@ before_install: - docker build -t ansible_master_centos7 master-centos7 - docker build -t ansible_master_centos6 master-centos6 + - docker build -t ansible_master_xenial_onbuild master-ubuntu16.04-onbuild - docker build -t ansible_master_trusty_onbuild master-ubuntu14.04-onbuild - docker build -t ansible_master_precise_onbuild master-ubuntu12.04-onbuild - docker build -t ansible_master_jessie_onbuild master-debian8-onbuild @@ -55,6 +59,7 @@ before_install: - docker build -t ansible_master_centos6_onbuild master-centos6-onbuild script: + - docker run -i ansible_xenial > result-ubuntu16.04 - docker run -i ansible_trusty > result-ubuntu14.04 - docker run -i ansible_precise > result-ubuntu12.04 - docker run -i ansible_jessie > result-debian8 @@ -62,6 +67,7 @@ script: - 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_xenial_onbuild > result-ubuntu16.04-onbuild - 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 @@ -87,12 +93,14 @@ script: - docker run -i ansible_1.9_alpine3_onbuild > result-1.9-alpine3-onbuild + - docker run -i ansible_master_xenial > result-master-ubuntu16.04 - docker run -i ansible_master_trusty > result-master-ubuntu14.04 - docker run -i ansible_master_precise > result-master-ubuntu12.04 - docker run -i ansible_master_jessie > result-master-debian8 - docker run -i ansible_master_wheezy > result-master-debian7 - docker run -i ansible_master_centos7 > result-master-centos7 - docker run -i ansible_master_centos6 > result-master-centos6 + - docker run -i ansible_master_xenial_onbuild > result-master-ubuntu16.04-onbuild - docker run -i ansible_master_trusty_onbuild > result-master-ubuntu14.04-onbuild - docker run -i ansible_master_precise_onbuild > result-master-ubuntu12.04-onbuild - docker run -i ansible_master_jessie_onbuild > result-master-debian8-onbuild @@ -103,6 +111,7 @@ script: - echo "==> Validating the test results..." + - sh -c "[ -s result-ubuntu16.04 ]" - sh -c "[ -s result-ubuntu14.04 ]" - sh -c "[ -s result-ubuntu12.04 ]" - sh -c "[ -s result-debian8 ]" @@ -110,6 +119,7 @@ script: - sh -c "[ -s result-centos7 ]" - sh -c "[ -s result-centos6 ]" - sh -c "[ -s result-alpine3 ]" + - sh -c "[ -s result-ubuntu16.04-onbuild ]" - sh -c "[ -s result-ubuntu14.04-onbuild ]" - sh -c "[ -s result-ubuntu12.04-onbuild ]" - sh -c "[ -s result-debian8-onbuild ]" @@ -133,12 +143,14 @@ script: - sh -c "[ -s result-1.9-centos6-onbuild ]" - sh -c "[ -s result-1.9-alpine3-onbuild ]" + - sh -c "[ -s result-master-ubuntu16.04 ]" - sh -c "[ -s result-master-ubuntu14.04 ]" - sh -c "[ -s result-master-ubuntu12.04 ]" - sh -c "[ -s result-master-debian8 ]" - sh -c "[ -s result-master-debian7 ]" - sh -c "[ -s result-master-centos7 ]" - sh -c "[ -s result-master-centos6 ]" + - sh -c "[ -s result-master-ubuntu16.04-onbuild ]" - sh -c "[ -s result-master-ubuntu14.04-onbuild ]" - sh -c "[ -s result-master-ubuntu12.04-onbuild ]" - sh -c "[ -s result-master-debian8-onbuild ]" diff --git a/1.9-alpine3-onbuild/Dockerfile b/1.9-alpine3-onbuild/Dockerfile index 2af2f48..aefffe7 100644 --- a/1.9-alpine3-onbuild/Dockerfile +++ b/1.9-alpine3-onbuild/Dockerfile @@ -13,9 +13,10 @@ MAINTAINER William Yeh 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 && \ + apk --update add python py-pip openssl ca-certificates && \ + apk --update add --virtual build-dependencies \ + python-dev libffi-dev openssl-dev build-base && \ + pip install --upgrade pip cffi && \ \ \ echo "===> Installing Ansible..." && \ diff --git a/1.9-alpine3/Dockerfile b/1.9-alpine3/Dockerfile index fe62f16..bf6d3ae 100644 --- a/1.9-alpine3/Dockerfile +++ b/1.9-alpine3/Dockerfile @@ -13,9 +13,10 @@ MAINTAINER William Yeh 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 && \ + apk --update add python py-pip openssl ca-certificates && \ + apk --update add --virtual build-dependencies \ + python-dev libffi-dev openssl-dev build-base && \ + pip install --upgrade pip cffi && \ \ \ echo "===> Installing Ansible..." && \ diff --git a/1.9-centos6-onbuild/Dockerfile b/1.9-centos6-onbuild/Dockerfile index 01fd565..ff7ce39 100644 --- a/1.9-centos6-onbuild/Dockerfile +++ b/1.9-centos6-onbuild/Dockerfile @@ -26,12 +26,13 @@ RUN echo "===> Installing EPEL..." && \ \ \ echo "===> Adding Ansible's prerequisites..." && \ - yum -y install gcc python-devel python-pip && \ + yum -y install gcc python-devel python-pip \ + libffi-devel openssl-devel && \ pip install --upgrade pip && \ \ \ echo "===> Installing Ansible..." && \ - pip install ansible==1.9.4 && \ + pip install --upgrade ansible==1.9.4 && \ \ \ echo "===> Disabling sudo 'requiretty' setting..." && \ @@ -39,7 +40,8 @@ RUN echo "===> Installing EPEL..." && \ \ \ echo "===> Removing unused YUM resources..." && \ - yum -y remove epel-release gcc python-devel python-pip && \ + yum -y remove epel-release gcc python-devel python-pip \ + libffi-devel openssl-devel || true && \ yum clean all && \ \ \ diff --git a/1.9-centos6/Dockerfile b/1.9-centos6/Dockerfile index dc450d6..f56f76f 100644 --- a/1.9-centos6/Dockerfile +++ b/1.9-centos6/Dockerfile @@ -26,12 +26,13 @@ RUN echo "===> Installing EPEL..." && \ \ \ echo "===> Adding Ansible's prerequisites..." && \ - yum -y install gcc python-devel python-pip && \ + yum -y install gcc python-devel python-pip \ + libffi-devel openssl-devel && \ pip install --upgrade pip && \ \ \ echo "===> Installing Ansible..." && \ - pip install ansible==1.9.4 && \ + pip install --upgrade ansible==1.9.4 && \ \ \ echo "===> Disabling sudo 'requiretty' setting..." && \ @@ -39,7 +40,8 @@ RUN echo "===> Installing EPEL..." && \ \ \ echo "===> Removing unused YUM resources..." && \ - yum -y remove epel-release gcc python-devel python-pip && \ + yum -y remove epel-release gcc python-devel python-pip \ + libffi-devel openssl-devel || true && \ yum clean all && \ \ \ diff --git a/1.9-centos7-onbuild/Dockerfile b/1.9-centos7-onbuild/Dockerfile index 7b8e028..ef182e6 100644 --- a/1.9-centos7-onbuild/Dockerfile +++ b/1.9-centos7-onbuild/Dockerfile @@ -41,12 +41,13 @@ RUN echo "===> Enabling systemd..." && \ \ \ echo "===> Adding Ansible's prerequisites..." && \ - yum -y install gcc python-devel python-pip && \ + yum -y install gcc python-devel python-pip \ + libffi-devel openssl-devel && \ pip install --upgrade pip && \ \ \ echo "===> Installing Ansible..." && \ - pip install ansible==1.9.4 && \ + pip install --upgrade ansible==1.9.4 && \ \ \ echo "===> Disabling sudo 'requiretty' setting..." && \ @@ -54,7 +55,8 @@ RUN echo "===> Enabling systemd..." && \ \ \ echo "===> Removing unused YUM resources..." && \ - yum -y remove epel-release gcc python-devel python-pip && \ + yum -y remove epel-release gcc python-devel python-pip \ + libffi-devel openssl-devel || true && \ yum clean all && \ \ \ diff --git a/1.9-centos7/Dockerfile b/1.9-centos7/Dockerfile index 8d6da85..9ae523a 100644 --- a/1.9-centos7/Dockerfile +++ b/1.9-centos7/Dockerfile @@ -41,12 +41,13 @@ RUN echo "===> Enabling systemd..." && \ \ \ echo "===> Adding Ansible's prerequisites..." && \ - yum -y install gcc python-devel python-pip && \ + yum -y install gcc python-devel python-pip \ + libffi-devel openssl-devel && \ pip install --upgrade pip && \ \ \ echo "===> Installing Ansible..." && \ - pip install ansible==1.9.4 && \ + pip install --upgrade ansible==1.9.4 && \ \ \ echo "===> Disabling sudo 'requiretty' setting..." && \ @@ -54,7 +55,8 @@ RUN echo "===> Enabling systemd..." && \ \ \ echo "===> Removing unused YUM resources..." && \ - yum -y remove epel-release gcc python-devel python-pip && \ + yum -y remove epel-release gcc python-devel python-pip \ + libffi-devel openssl-devel || true && \ yum clean all && \ \ \ diff --git a/1.9-debian7-onbuild/Dockerfile b/1.9-debian7-onbuild/Dockerfile index 5ca7ce3..ec8f2d1 100644 --- a/1.9-debian7-onbuild/Dockerfile +++ b/1.9-debian7-onbuild/Dockerfile @@ -13,11 +13,12 @@ MAINTAINER William Yeh RUN echo "===> Installing python, sudo, and supporting tools..." && \ - apt-get update && \ + apt-get update -y && apt-get install --fix-missing && \ DEBIAN_FRONTEND=noninteractive \ apt-get install -y \ python python-yaml sudo \ - curl gcc python-pip python-dev && \ + curl gcc python-pip python-dev libffi-dev libssl-dev && \ + pip install --upgrade cffi && \ \ \ echo "===> Installing Ansible..." && \ @@ -25,7 +26,8 @@ RUN echo "===> Installing python, sudo, and supporting tools..." && \ \ \ echo "===> Removing unused APT resources..." && \ - apt-get -f -y --auto-remove remove gcc python-pip python-dev && \ + apt-get -f -y --auto-remove remove \ + gcc python-pip python-dev libffi-dev libssl-dev && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* && \ \ diff --git a/1.9-debian7/Dockerfile b/1.9-debian7/Dockerfile index 8d746e7..5033911 100644 --- a/1.9-debian7/Dockerfile +++ b/1.9-debian7/Dockerfile @@ -13,11 +13,12 @@ MAINTAINER William Yeh RUN echo "===> Installing python, sudo, and supporting tools..." && \ - apt-get update && \ + apt-get update -y && apt-get install --fix-missing && \ DEBIAN_FRONTEND=noninteractive \ apt-get install -y \ python python-yaml sudo \ - curl gcc python-pip python-dev && \ + curl gcc python-pip python-dev libffi-dev libssl-dev && \ + pip install --upgrade cffi && \ \ \ echo "===> Installing Ansible..." && \ @@ -25,7 +26,8 @@ RUN echo "===> Installing python, sudo, and supporting tools..." && \ \ \ echo "===> Removing unused APT resources..." && \ - apt-get -f -y --auto-remove remove gcc python-pip python-dev && \ + apt-get -f -y --auto-remove remove \ + gcc python-pip python-dev libffi-dev libssl-dev && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* && \ \ diff --git a/1.9-debian8-onbuild/Dockerfile b/1.9-debian8-onbuild/Dockerfile index 66756bd..5ad3bb3 100644 --- a/1.9-debian8-onbuild/Dockerfile +++ b/1.9-debian8-onbuild/Dockerfile @@ -13,11 +13,13 @@ MAINTAINER William Yeh RUN echo "===> Installing python, sudo, and supporting tools..." && \ - apt-get update && \ + apt-get update -y && apt-get install --fix-missing && \ DEBIAN_FRONTEND=noninteractive \ apt-get install -y \ python python-yaml sudo \ - curl gcc python-pip python-dev && \ + curl gcc python-pip python-dev libffi-dev libssl-dev && \ + apt-get -y --purge remove python-cffi && \ + pip install --upgrade cffi && \ \ \ echo "===> Installing Ansible..." && \ @@ -25,7 +27,8 @@ RUN echo "===> Installing python, sudo, and supporting tools..." && \ \ \ echo "===> Removing unused APT resources..." && \ - apt-get -f -y --auto-remove remove gcc python-pip python-dev && \ + apt-get -f -y --auto-remove remove \ + gcc python-pip python-dev libffi-dev libssl-dev && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* && \ \ diff --git a/1.9-debian8/Dockerfile b/1.9-debian8/Dockerfile index 47d59e1..c76477d 100644 --- a/1.9-debian8/Dockerfile +++ b/1.9-debian8/Dockerfile @@ -13,11 +13,13 @@ MAINTAINER William Yeh RUN echo "===> Installing python, sudo, and supporting tools..." && \ - apt-get update && \ + apt-get update -y && apt-get install --fix-missing && \ DEBIAN_FRONTEND=noninteractive \ apt-get install -y \ python python-yaml sudo \ - curl gcc python-pip python-dev && \ + curl gcc python-pip python-dev libffi-dev libssl-dev && \ + apt-get -y --purge remove python-cffi && \ + pip install --upgrade cffi && \ \ \ echo "===> Installing Ansible..." && \ @@ -25,7 +27,8 @@ RUN echo "===> Installing python, sudo, and supporting tools..." && \ \ \ echo "===> Removing unused APT resources..." && \ - apt-get -f -y --auto-remove remove gcc python-pip python-dev && \ + apt-get -f -y --auto-remove remove \ + gcc python-pip python-dev libffi-dev libssl-dev && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* && \ \ diff --git a/README.md b/README.md index 89a7c24..f0baebb 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ This repository contains Dockerized [Ansible](https://github.com/ansible/ansible 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), Alpine (3). +- OS: Debian (jessie, wheezy), Ubuntu (xenial, trusty, precise), CentOS (7, 6), Alpine (3). - Ansible: three version series - @@ -33,6 +33,7 @@ These are Docker images for [Ansible](https://github.com/ansible/ansible) softwa - `williamyeh/ansible:debian8` - `williamyeh/ansible:debian7` + - `williamyeh/ansible:ubuntu16.04` - `williamyeh/ansible:ubuntu14.04` - `williamyeh/ansible:ubuntu12.04` - `williamyeh/ansible:centos7` @@ -43,6 +44,7 @@ These are Docker images for [Ansible](https://github.com/ansible/ansible) softwa - `williamyeh/ansible:debian8-onbuild` - `williamyeh/ansible:debian7-onbuild` + - `williamyeh/ansible:ubuntu16.04-onbuild` - `williamyeh/ansible:ubuntu14.04-onbuild` - `williamyeh/ansible:ubuntu12.04-onbuild` - `williamyeh/ansible:centos7-onbuild` @@ -77,6 +79,7 @@ These are Docker images for [Ansible](https://github.com/ansible/ansible) softwa - `williamyeh/ansible:master-debian8` - `williamyeh/ansible:master-debian7` + - `williamyeh/ansible:master-ubuntu16.04` - `williamyeh/ansible:master-ubuntu14.04` - `williamyeh/ansible:master-ubuntu12.04` - `williamyeh/ansible:master-centos7` @@ -86,6 +89,7 @@ These are Docker images for [Ansible](https://github.com/ansible/ansible) softwa - `williamyeh/ansible:master-debian8-onbuild` - `williamyeh/ansible:master-debian7-onbuild` + - `williamyeh/ansible:master-ubuntu16.04-onbuild` - `williamyeh/ansible:master-ubuntu14.04-onbuild` - `williamyeh/ansible:master-ubuntu12.04-onbuild` - `williamyeh/ansible:master-centos7-onbuild` @@ -121,7 +125,7 @@ Third, `docker build .` Done! -For more advanced usage, the role in Ansible Galaxy [`williamyeh/nginx`](https://galaxy.ansible.com/williamyeh/nginx/) demonstrates how to perform a simple smoke test (*configuration needs test, too!*) on a variety of (*containerized*) Linux distributions via [CircleCI](https://circleci.com/)'s Ubuntu 12.04 and [Travis CI](https://travis-ci.org/)’s Ubuntu 14.04 worker instances. +For more advanced usage, the role in Ansible Galaxy [`williamyeh/nginx`](https://galaxy.ansible.com/williamyeh/nginx/) demonstrates how to perform a simple smoke test (*configuration needs test, too!*) on a variety of (*containerized*) Linux distributions on [CircleCI](https://circleci.com/)'s Ubuntu 12.04 and [Travis CI](https://travis-ci.org/)’s Ubuntu 14.04 worker instances. @@ -170,6 +174,7 @@ Take Debian/Ubuntu/CentOS for example. To test an Ansible `playbook.yml` against Vagrant.configure(2) do |config| # ==> Choose a Vagrant box to emulate Linux distribution... + #config.vm.box = "ubuntu/xenial64" config.vm.box = "ubuntu/trusty64" #config.vm.box = "ubuntu/precise64" #config.vm.box = "debian/jessie64" @@ -197,6 +202,7 @@ Docker to be a rescue. Now, with these **williamyeh/ansible** series, we may tes # Dockerfile # ==> Choose a base image to emulate Linux distribution... +#FROM williamyeh/ansible:ubuntu16.04 FROM williamyeh/ansible:ubuntu14.04 #FROM williamyeh/ansible:ubuntu12.04 #FROM williamyeh/ansible:debian8 @@ -224,6 +230,7 @@ You may also work with `onbuild` series, which take care of many routine steps f # Dockerfile # ==> Choose a base image to emulate Linux distribution... +#FROM williamyeh/ansible:ubuntu16.04-onbuild FROM williamyeh/ansible:ubuntu14.04-onbuild #FROM williamyeh/ansible:ubuntu12.04-onbuild #FROM williamyeh/ansible:debian8-onbuild diff --git a/Vagrantfile b/Vagrantfile index 46458fb..9bb4898 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -4,6 +4,7 @@ Vagrant.configure(2) do |config| config.vm.provision "shell", inline: <<-SHELL cd /vagrant + docker build -t ansible:ubuntu16.04 ubuntu16.04 docker build -t ansible:ubuntu14.04 ubuntu14.04 docker build -t ansible:ubuntu12.04 ubuntu12.04 docker build -t ansible:debian8 debian8 @@ -12,6 +13,7 @@ Vagrant.configure(2) do |config| docker build -t ansible:centos6 centos6 docker build -t ansible:alpine3 alpine3 + docker build -t ansible:ubuntu16.04-onbuild ubuntu16.04-onbuild docker build -t ansible:ubuntu14.04-onbuild ubuntu14.04-onbuild docker build -t ansible:ubuntu12.04-onbuild ubuntu12.04-onbuild docker build -t ansible:debian8-onbuild debian8-onbuild diff --git a/alpine3-onbuild/Dockerfile b/alpine3-onbuild/Dockerfile index 777ddec..a11dc9e 100644 --- a/alpine3-onbuild/Dockerfile +++ b/alpine3-onbuild/Dockerfile @@ -13,9 +13,10 @@ MAINTAINER William Yeh 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 && \ + apk --update add python py-pip openssl ca-certificates && \ + apk --update add --virtual build-dependencies \ + python-dev libffi-dev openssl-dev build-base && \ + pip install --upgrade pip cffi && \ \ \ echo "===> Installing Ansible..." && \ diff --git a/alpine3/Dockerfile b/alpine3/Dockerfile index 28550b2..87b22c7 100644 --- a/alpine3/Dockerfile +++ b/alpine3/Dockerfile @@ -13,9 +13,10 @@ MAINTAINER William Yeh 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 && \ + apk --update add python py-pip openssl ca-certificates && \ + apk --update add --virtual build-dependencies \ + python-dev libffi-dev openssl-dev build-base && \ + pip install --upgrade pip cffi && \ \ \ echo "===> Installing Ansible..." && \ diff --git a/centos6-onbuild/Dockerfile b/centos6-onbuild/Dockerfile index 56855ef..a520a0f 100644 --- a/centos6-onbuild/Dockerfile +++ b/centos6-onbuild/Dockerfile @@ -26,12 +26,13 @@ RUN echo "===> Installing EPEL..." && \ \ \ echo "===> Adding Ansible's prerequisites..." && \ - yum -y install gcc python-devel python-pip && \ + yum -y install gcc python-devel python-pip \ + libffi-devel openssl-devel && \ pip install --upgrade pip && \ \ \ echo "===> Installing Ansible..." && \ - pip install ansible && \ + pip install --upgrade ansible && \ \ \ echo "===> Disabling sudo 'requiretty' setting..." && \ @@ -39,7 +40,8 @@ RUN echo "===> Installing EPEL..." && \ \ \ echo "===> Removing unused YUM resources..." && \ - yum -y remove epel-release gcc python-devel python-pip && \ + yum -y remove epel-release gcc python-devel python-pip \ + libffi-devel openssl-devel || true && \ yum clean all && \ \ \ diff --git a/centos6/Dockerfile b/centos6/Dockerfile index fe13935..034e5a8 100644 --- a/centos6/Dockerfile +++ b/centos6/Dockerfile @@ -26,12 +26,13 @@ RUN echo "===> Installing EPEL..." && \ \ \ echo "===> Adding Ansible's prerequisites..." && \ - yum -y install gcc python-devel python-pip && \ + yum -y install gcc python-devel python-pip \ + libffi-devel openssl-devel && \ pip install --upgrade pip && \ \ \ echo "===> Installing Ansible..." && \ - pip install ansible && \ + pip install --upgrade ansible && \ \ \ echo "===> Disabling sudo 'requiretty' setting..." && \ @@ -39,7 +40,8 @@ RUN echo "===> Installing EPEL..." && \ \ \ echo "===> Removing unused YUM resources..." && \ - yum -y remove epel-release gcc python-devel python-pip && \ + yum -y remove epel-release gcc python-devel python-pip \ + libffi-devel openssl-devel || true && \ yum clean all && \ \ \ diff --git a/centos7-onbuild/Dockerfile b/centos7-onbuild/Dockerfile index 9274bee..4edadbc 100644 --- a/centos7-onbuild/Dockerfile +++ b/centos7-onbuild/Dockerfile @@ -41,12 +41,13 @@ RUN echo "===> Enabling systemd..." && \ \ \ echo "===> Adding Ansible's prerequisites..." && \ - yum -y install gcc python-devel python-pip && \ + yum -y install gcc python-devel python-pip \ + libffi-devel openssl-devel && \ pip install --upgrade pip && \ \ \ echo "===> Installing Ansible..." && \ - pip install ansible && \ + pip install --upgrade ansible && \ \ \ echo "===> Disabling sudo 'requiretty' setting..." && \ @@ -54,7 +55,8 @@ RUN echo "===> Enabling systemd..." && \ \ \ echo "===> Removing unused YUM resources..." && \ - yum -y remove epel-release gcc python-devel python-pip && \ + yum -y remove epel-release gcc python-devel python-pip \ + libffi-devel openssl-devel || true && \ yum clean all && \ \ \ diff --git a/centos7/Dockerfile b/centos7/Dockerfile index 0f2112d..6ea7e84 100644 --- a/centos7/Dockerfile +++ b/centos7/Dockerfile @@ -41,12 +41,13 @@ RUN echo "===> Enabling systemd..." && \ \ \ echo "===> Adding Ansible's prerequisites..." && \ - yum -y install gcc python-devel python-pip && \ + yum -y install gcc python-devel python-pip \ + libffi-devel openssl-devel && \ pip install --upgrade pip && \ \ \ echo "===> Installing Ansible..." && \ - pip install ansible && \ + pip install --upgrade ansible && \ \ \ echo "===> Disabling sudo 'requiretty' setting..." && \ @@ -54,7 +55,8 @@ RUN echo "===> Enabling systemd..." && \ \ \ echo "===> Removing unused YUM resources..." && \ - yum -y remove epel-release gcc python-devel python-pip && \ + yum -y remove epel-release gcc python-devel python-pip \ + libffi-devel openssl-devel || true && \ yum clean all && \ \ \ diff --git a/circle.yml b/circle.yml index 6867955..60cbe28 100644 --- a/circle.yml +++ b/circle.yml @@ -7,6 +7,7 @@ dependencies: - docker info - docker version + - docker build -t ansible_xenial ubuntu16.04 - docker build -t ansible_trusty ubuntu14.04 - docker build -t ansible_precise ubuntu12.04 - docker build -t ansible_jessie debian8 @@ -15,6 +16,7 @@ dependencies: - docker build -t ansible_centos6 centos6 - docker build -t ansible_alpine3 alpine3 + - docker build -t ansible_xenial_onbuild ubuntu16.04-onbuild - docker build -t ansible_trusty_onbuild ubuntu14.04-onbuild - docker build -t ansible_precise_onbuild ubuntu12.04-onbuild - docker build -t ansible_jessie_onbuild debian8-onbuild @@ -41,6 +43,7 @@ dependencies: - docker build -t ansible_1.9_alpine3_onbuild 1.9-alpine3-onbuild + - docker build -t ansible_master_xenial master-ubuntu16.04 - docker build -t ansible_master_trusty master-ubuntu14.04 - docker build -t ansible_master_precise master-ubuntu12.04 - docker build -t ansible_master_jessie master-debian8 @@ -48,6 +51,7 @@ dependencies: - docker build -t ansible_master_centos7 master-centos7 - docker build -t ansible_master_centos6 master-centos6 + - docker build -t ansible_master_xenial_onbuild master-ubuntu16.04-onbuild - docker build -t ansible_master_trusty_onbuild master-ubuntu14.04-onbuild - docker build -t ansible_master_precise_onbuild master-ubuntu12.04-onbuild - docker build -t ansible_master_jessie_onbuild master-debian8-onbuild @@ -57,6 +61,7 @@ dependencies: test: override: + - docker run -i ansible_xenial > result-ubuntu16.04 - docker run -i ansible_trusty > result-ubuntu14.04 - docker run -i ansible_precise > result-ubuntu12.04 - docker run -i ansible_jessie > result-debian8 @@ -64,6 +69,7 @@ test: - 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_xenial_onbuild > result-ubuntu16.04-onbuild - 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 @@ -89,12 +95,14 @@ test: - docker run -i ansible_1.9_alpine3_onbuild > result-1.9-alpine3-onbuild + - docker run -i ansible_master_xenial > result-master-ubuntu16.04 - docker run -i ansible_master_trusty > result-master-ubuntu14.04 - docker run -i ansible_master_precise > result-master-ubuntu12.04 - docker run -i ansible_master_jessie > result-master-debian8 - docker run -i ansible_master_wheezy > result-master-debian7 - docker run -i ansible_master_centos7 > result-master-centos7 - docker run -i ansible_master_centos6 > result-master-centos6 + - docker run -i ansible_master_xenial_onbuild > result-master-ubuntu16.04-onbuild - docker run -i ansible_master_trusty_onbuild > result-master-ubuntu14.04-onbuild - docker run -i ansible_master_precise_onbuild > result-master-ubuntu12.04-onbuild - docker run -i ansible_master_jessie_onbuild > result-master-debian8-onbuild @@ -105,6 +113,7 @@ test: - echo "==> Validating the test results..." + - sh -c "[ -s result-ubuntu16.04 ]" - sh -c "[ -s result-ubuntu14.04 ]" - sh -c "[ -s result-ubuntu12.04 ]" - sh -c "[ -s result-debian8 ]" @@ -112,6 +121,7 @@ test: - sh -c "[ -s result-centos7 ]" - sh -c "[ -s result-centos6 ]" - sh -c "[ -s result-alpine3 ]" + - sh -c "[ -s result-ubuntu16.04-onbuild ]" - sh -c "[ -s result-ubuntu14.04-onbuild ]" - sh -c "[ -s result-ubuntu12.04-onbuild ]" - sh -c "[ -s result-debian8-onbuild ]" @@ -135,12 +145,14 @@ test: - sh -c "[ -s result-1.9-centos6-onbuild ]" - sh -c "[ -s result-1.9-alpine3-onbuild ]" + - sh -c "[ -s result-master-ubuntu16.04 ]" - sh -c "[ -s result-master-ubuntu14.04 ]" - sh -c "[ -s result-master-ubuntu12.04 ]" - sh -c "[ -s result-master-debian8 ]" - sh -c "[ -s result-master-debian7 ]" - sh -c "[ -s result-master-centos7 ]" - sh -c "[ -s result-master-centos6 ]" + - sh -c "[ -s result-master-ubuntu16.04-onbuild ]" - sh -c "[ -s result-master-ubuntu14.04-onbuild ]" - sh -c "[ -s result-master-ubuntu12.04-onbuild ]" - sh -c "[ -s result-master-debian8-onbuild ]" diff --git a/compare-image-size.sh b/compare-image-size.sh index 9c7c5cd..6a8ae88 100755 --- a/compare-image-size.sh +++ b/compare-image-size.sh @@ -4,6 +4,7 @@ declare -a IMAGES=( 'ansible/ubuntu14.04-ansible:stable' 'ansible/centos7-ansible:stable' \ "williamyeh/ansible:debian8-onbuild" \ "williamyeh/ansible:debian7-onbuild" \ + "williamyeh/ansible:ubuntu16.04-onbuild" \ "williamyeh/ansible:ubuntu14.04-onbuild" \ "williamyeh/ansible:ubuntu12.04-onbuild" \ "williamyeh/ansible:centos7-onbuild" \ diff --git a/debian7-onbuild/Dockerfile b/debian7-onbuild/Dockerfile index fb823fd..a6e1a30 100644 --- a/debian7-onbuild/Dockerfile +++ b/debian7-onbuild/Dockerfile @@ -13,11 +13,12 @@ MAINTAINER William Yeh RUN echo "===> Installing python, sudo, and supporting tools..." && \ - apt-get update && \ + apt-get update -y && apt-get install --fix-missing && \ DEBIAN_FRONTEND=noninteractive \ apt-get install -y \ python python-yaml sudo \ - curl gcc python-pip python-dev && \ + curl gcc python-pip python-dev libffi-dev libssl-dev && \ + pip install --upgrade cffi && \ \ \ echo "===> Installing Ansible..." && \ @@ -25,7 +26,8 @@ RUN echo "===> Installing python, sudo, and supporting tools..." && \ \ \ echo "===> Removing unused APT resources..." && \ - apt-get -f -y --auto-remove remove gcc python-pip python-dev && \ + apt-get -f -y --auto-remove remove \ + gcc python-pip python-dev libffi-dev libssl-dev && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* && \ \ diff --git a/debian7/Dockerfile b/debian7/Dockerfile index 73ea5d9..25cc25b 100644 --- a/debian7/Dockerfile +++ b/debian7/Dockerfile @@ -13,11 +13,12 @@ MAINTAINER William Yeh RUN echo "===> Installing python, sudo, and supporting tools..." && \ - apt-get update && \ + apt-get update -y && apt-get install --fix-missing && \ DEBIAN_FRONTEND=noninteractive \ apt-get install -y \ python python-yaml sudo \ - curl gcc python-pip python-dev && \ + curl gcc python-pip python-dev libffi-dev libssl-dev && \ + pip install --upgrade cffi && \ \ \ echo "===> Installing Ansible..." && \ @@ -25,7 +26,8 @@ RUN echo "===> Installing python, sudo, and supporting tools..." && \ \ \ echo "===> Removing unused APT resources..." && \ - apt-get -f -y --auto-remove remove gcc python-pip python-dev && \ + apt-get -f -y --auto-remove remove \ + gcc python-pip python-dev libffi-dev libssl-dev && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* && \ \ diff --git a/debian8-onbuild/Dockerfile b/debian8-onbuild/Dockerfile index c5fc227..f21a6b0 100644 --- a/debian8-onbuild/Dockerfile +++ b/debian8-onbuild/Dockerfile @@ -13,11 +13,13 @@ MAINTAINER William Yeh RUN echo "===> Installing python, sudo, and supporting tools..." && \ - apt-get update && \ + apt-get update -y && apt-get install --fix-missing && \ DEBIAN_FRONTEND=noninteractive \ apt-get install -y \ python python-yaml sudo \ - curl gcc python-pip python-dev && \ + curl gcc python-pip python-dev libffi-dev libssl-dev && \ + apt-get -y --purge remove python-cffi && \ + pip install --upgrade cffi && \ \ \ echo "===> Installing Ansible..." && \ @@ -25,7 +27,8 @@ RUN echo "===> Installing python, sudo, and supporting tools..." && \ \ \ echo "===> Removing unused APT resources..." && \ - apt-get -f -y --auto-remove remove gcc python-pip python-dev && \ + apt-get -f -y --auto-remove remove \ + gcc python-pip python-dev libffi-dev libssl-dev && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* && \ \ diff --git a/debian8/Dockerfile b/debian8/Dockerfile index e7ead92..1a30239 100644 --- a/debian8/Dockerfile +++ b/debian8/Dockerfile @@ -13,11 +13,13 @@ MAINTAINER William Yeh RUN echo "===> Installing python, sudo, and supporting tools..." && \ - apt-get update && \ + apt-get update -y && apt-get install --fix-missing && \ DEBIAN_FRONTEND=noninteractive \ apt-get install -y \ python python-yaml sudo \ - curl gcc python-pip python-dev && \ + curl gcc python-pip python-dev libffi-dev libssl-dev && \ + apt-get -y --purge remove python-cffi && \ + pip install --upgrade cffi && \ \ \ echo "===> Installing Ansible..." && \ @@ -25,7 +27,8 @@ RUN echo "===> Installing python, sudo, and supporting tools..." && \ \ \ echo "===> Removing unused APT resources..." && \ - apt-get -f -y --auto-remove remove gcc python-pip python-dev && \ + apt-get -f -y --auto-remove remove \ + gcc python-pip python-dev libffi-dev libssl-dev && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* && \ \ diff --git a/master-centos6-onbuild/Dockerfile b/master-centos6-onbuild/Dockerfile index 4b8585d..091bad2 100644 --- a/master-centos6-onbuild/Dockerfile +++ b/master-centos6-onbuild/Dockerfile @@ -30,6 +30,7 @@ RUN echo "===> Installing EPEL..." && \ yum -y install \ gcc make \ python python-devel python-pip \ + libffi-devel openssl-devel \ libxml2 libxml2-devel libxslt libxslt-devel \ git sudo curl && \ pip install --upgrade pip && \ @@ -58,9 +59,9 @@ RUN echo "===> Installing EPEL..." && \ sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers && \ \ \ - echo "===> Removing unused YUM resources..." && \ - yum -y remove \ - epel-release python-devel python-pip gcc git && \ + echo "===> Removing unused YUM resources..." && \ + yum -y remove epel-release gcc git python-devel python-pip \ + libffi-devel openssl-devel || true && \ yum clean all && \ \ \ diff --git a/master-centos6/Dockerfile b/master-centos6/Dockerfile index d90a08b..8469d65 100644 --- a/master-centos6/Dockerfile +++ b/master-centos6/Dockerfile @@ -30,6 +30,7 @@ RUN echo "===> Installing EPEL..." && \ yum -y install \ gcc make \ python python-devel python-pip \ + libffi-devel openssl-devel \ libxml2 libxml2-devel libxslt libxslt-devel \ git sudo curl && \ pip install --upgrade pip && \ @@ -58,10 +59,10 @@ RUN echo "===> Installing EPEL..." && \ sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers && \ \ \ - echo "===> Removing unused YUM resources..." && \ - yum -y remove \ - epel-release python-devel python-pip gcc git && \ - yum clean all && \ + echo "===> Removing unused YUM resources..." && \ + yum -y remove epel-release gcc git python-devel python-pip \ + libffi-devel openssl-devel || true && \ + yum clean all && \ \ \ echo "===> Adding hosts for convenience..." && \ diff --git a/master-centos7-onbuild/Dockerfile b/master-centos7-onbuild/Dockerfile index 6d3fa21..24d4ca9 100644 --- a/master-centos7-onbuild/Dockerfile +++ b/master-centos7-onbuild/Dockerfile @@ -31,7 +31,7 @@ RUN echo "===> Enabling systemd..." && \ rm -f /lib/systemd/system/basic.target.wants/*; \ rm -f /lib/systemd/system/anaconda.target.wants/* && \ \ - \ + \ echo "===> Installing EPEL..." && \ yum -y install epel-release && \ yum -y update && \ @@ -45,6 +45,7 @@ RUN echo "===> Enabling systemd..." && \ yum -y install \ gcc make \ python python-devel python-pip \ + libffi-devel openssl-devel \ libxml2 libxml2-devel libxslt libxslt-devel \ git sudo curl && \ pip install --upgrade pip && \ @@ -73,10 +74,10 @@ RUN echo "===> Enabling systemd..." && \ sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers && \ \ \ - echo "===> Removing unused YUM resources..." && \ - yum -y remove \ - epel-release python-devel python-pip gcc git && \ - yum clean all && \ + echo "===> Removing unused YUM resources..." && \ + yum -y remove epel-release gcc git python-devel python-pip \ + libffi-devel openssl-devel || true && \ + yum clean all && \ \ \ echo "===> Adding hosts for convenience..." && \ @@ -87,7 +88,7 @@ RUN echo "===> Enabling systemd..." && \ # # [Quote] https://hub.docker.com/_/centos/ # -# "In order to run a container with systemd, +# "In order to run a container with systemd, # you will need to mount the cgroups volumes from the host. # [...] # There have been reports that if you're using an Ubuntu host, diff --git a/master-centos7/Dockerfile b/master-centos7/Dockerfile index 51dae60..75711d8 100644 --- a/master-centos7/Dockerfile +++ b/master-centos7/Dockerfile @@ -31,7 +31,7 @@ RUN echo "===> Enabling systemd..." && \ rm -f /lib/systemd/system/basic.target.wants/*; \ rm -f /lib/systemd/system/anaconda.target.wants/* && \ \ - \ + \ echo "===> Installing EPEL..." && \ yum -y install epel-release && \ yum -y update && \ @@ -45,6 +45,7 @@ RUN echo "===> Enabling systemd..." && \ yum -y install \ gcc make \ python python-devel python-pip \ + libffi-devel openssl-devel \ libxml2 libxml2-devel libxslt libxslt-devel \ git sudo curl && \ pip install --upgrade pip && \ @@ -73,10 +74,10 @@ RUN echo "===> Enabling systemd..." && \ sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers && \ \ \ - echo "===> Removing unused YUM resources..." && \ - yum -y remove \ - epel-release python-devel python-pip gcc git && \ - yum clean all && \ + echo "===> Removing unused YUM resources..." && \ + yum -y remove epel-release gcc git python-devel python-pip \ + libffi-devel openssl-devel || true && \ + yum clean all && \ \ \ echo "===> Adding hosts for convenience..." && \ @@ -87,7 +88,7 @@ RUN echo "===> Enabling systemd..." && \ # # [Quote] https://hub.docker.com/_/centos/ # -# "In order to run a container with systemd, +# "In order to run a container with systemd, # you will need to mount the cgroups volumes from the host. # [...] # There have been reports that if you're using an Ubuntu host, diff --git a/master-debian7-onbuild/Dockerfile b/master-debian7-onbuild/Dockerfile index 1222020..e787e2d 100644 --- a/master-debian7-onbuild/Dockerfile +++ b/master-debian7-onbuild/Dockerfile @@ -12,14 +12,16 @@ FROM debian:wheezy MAINTAINER William Yeh -RUN echo "===> Adding Ansible's prerequisites..." && \ - apt-get update -y && \ +RUN echo "===> Adding Ansible's prerequisites..." && \ + apt-get update -y && apt-get install --fix-missing && \ DEBIAN_FRONTEND=noninteractive \ apt-get install --no-install-recommends -y -q \ build-essential ca-certificates \ python-pip python-dev python-yaml \ + libffi-dev libssl-dev \ libxml2-dev libxslt1-dev zlib1g-dev \ git sudo curl && \ + pip install --upgrade cffi && \ pip install --upgrade pyyaml jinja2 pycrypto && \ \ \ @@ -40,11 +42,11 @@ RUN echo "===> Adding Ansible's prerequisites..." && \ rm -rf /ansible && \ \ \ - echo "===> Clean up..." && \ + echo "===> Clean up..." && \ apt-get remove -y --auto-remove \ - build-essential python-pip python-dev git && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* && \ + build-essential python-pip python-dev git libffi-dev libssl-dev && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* && \ \ \ echo "===> Adding hosts for convenience..." && \ diff --git a/master-debian7/Dockerfile b/master-debian7/Dockerfile index 5c7f2c4..8a81696 100644 --- a/master-debian7/Dockerfile +++ b/master-debian7/Dockerfile @@ -12,14 +12,16 @@ FROM debian:wheezy MAINTAINER William Yeh -RUN echo "===> Adding Ansible's prerequisites..." && \ - apt-get update -y && \ +RUN echo "===> Adding Ansible's prerequisites..." && \ + apt-get update -y && apt-get install --fix-missing && \ DEBIAN_FRONTEND=noninteractive \ apt-get install --no-install-recommends -y -q \ build-essential ca-certificates \ python-pip python-dev python-yaml \ + libffi-dev libssl-dev \ libxml2-dev libxslt1-dev zlib1g-dev \ git sudo curl && \ + pip install --upgrade cffi && \ pip install --upgrade pyyaml jinja2 pycrypto && \ \ \ @@ -40,11 +42,11 @@ RUN echo "===> Adding Ansible's prerequisites..." && \ rm -rf /ansible && \ \ \ - echo "===> Clean up..." && \ + echo "===> Clean up..." && \ apt-get remove -y --auto-remove \ - build-essential python-pip python-dev git && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* && \ + build-essential python-pip python-dev git libffi-dev libssl-dev && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* && \ \ \ echo "===> Adding hosts for convenience..." && \ diff --git a/master-debian8-onbuild/Dockerfile b/master-debian8-onbuild/Dockerfile index 19d4934..c9ce493 100644 --- a/master-debian8-onbuild/Dockerfile +++ b/master-debian8-onbuild/Dockerfile @@ -12,14 +12,17 @@ FROM debian:jessie MAINTAINER William Yeh -RUN echo "===> Adding Ansible's prerequisites..." && \ - apt-get update -y && \ +RUN echo "===> Adding Ansible's prerequisites..." && \ + apt-get update -y && apt-get install --fix-missing && \ DEBIAN_FRONTEND=noninteractive \ apt-get install --no-install-recommends -y -q \ build-essential ca-certificates \ python-pip python-dev python-yaml \ + libffi-dev libssl-dev \ libxml2-dev libxslt1-dev zlib1g-dev \ git sudo curl && \ + apt-get -y --purge remove python-cffi && \ + pip install --upgrade cffi && \ pip install --upgrade pyyaml jinja2 pycrypto && \ \ \ @@ -40,11 +43,11 @@ RUN echo "===> Adding Ansible's prerequisites..." && \ rm -rf /ansible && \ \ \ - echo "===> Clean up..." && \ + echo "===> Clean up..." && \ apt-get remove -y --auto-remove \ - build-essential python-pip python-dev git && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* && \ + build-essential python-pip python-dev git libffi-dev libssl-dev && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* && \ \ \ echo "===> Adding hosts for convenience..." && \ diff --git a/master-debian8/Dockerfile b/master-debian8/Dockerfile index fcf957c..d18b0f8 100644 --- a/master-debian8/Dockerfile +++ b/master-debian8/Dockerfile @@ -12,14 +12,17 @@ FROM debian:jessie MAINTAINER William Yeh -RUN echo "===> Adding Ansible's prerequisites..." && \ - apt-get update -y && \ +RUN echo "===> Adding Ansible's prerequisites..." && \ + apt-get update -y && apt-get install --fix-missing && \ DEBIAN_FRONTEND=noninteractive \ apt-get install --no-install-recommends -y -q \ build-essential ca-certificates \ python-pip python-dev python-yaml \ + libffi-dev libssl-dev \ libxml2-dev libxslt1-dev zlib1g-dev \ git sudo curl && \ + apt-get -y --purge remove python-cffi && \ + pip install --upgrade cffi && \ pip install --upgrade pyyaml jinja2 pycrypto && \ \ \ @@ -40,11 +43,11 @@ RUN echo "===> Adding Ansible's prerequisites..." && \ rm -rf /ansible && \ \ \ - echo "===> Clean up..." && \ + echo "===> Clean up..." && \ apt-get remove -y --auto-remove \ - build-essential python-pip python-dev git && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* && \ + build-essential python-pip python-dev git libffi-dev libssl-dev && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* && \ \ \ echo "===> Adding hosts for convenience..." && \ diff --git a/master-ubuntu16.04-onbuild/Dockerfile b/master-ubuntu16.04-onbuild/Dockerfile new file mode 100644 index 0000000..bbd0029 --- /dev/null +++ b/master-ubuntu16.04-onbuild/Dockerfile @@ -0,0 +1,77 @@ +# Dockerfile for building Ansible image from source for Ubuntu 16.04 (Xenial), with as few additional software as possible. +# +# @see http://docs.ansible.com/ansible/intro_installation.html#running-from-source +# +# Version 1.0 +# + + +# pull base image +FROM ubuntu:16.04 + +MAINTAINER William Yeh + + +RUN echo "===> Adding Ansible's prerequisites..." && \ + apt-get update -y && \ + DEBIAN_FRONTEND=noninteractive \ + apt-get install --no-install-recommends -y -q \ + build-essential \ + python-pip python-dev python-yaml \ + libffi-dev libssl-dev \ + libxml2-dev libxslt1-dev zlib1g-dev \ + git && \ + pip install --upgrade wheel setuptools && \ + pip install --upgrade pyyaml jinja2 pycrypto && \ + \ + \ + echo "===> Downloading Ansible's source tree..." && \ + git clone git://github.com/ansible/ansible.git --recursive && \ + \ + \ + echo "===> Compiling Ansible..." && \ + cd ansible && \ + bash -c 'source ./hacking/env-setup' && \ + \ + \ + echo "===> Moving useful Ansible stuff to /opt/ansible ..." && \ + mkdir -p /opt/ansible && \ + mv /ansible/bin /opt/ansible/bin && \ + mv /ansible/lib /opt/ansible/lib && \ + mv /ansible/docs /opt/ansible/docs && \ + rm -rf /ansible && \ + \ + \ + echo "===> Clean up..." && \ + apt-get remove -y --auto-remove \ + build-essential python-pip python-dev git libffi-dev libssl-dev && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* && \ + \ + \ + echo "===> Adding hosts for convenience..." && \ + mkdir -p /etc/ansible && \ + echo 'localhost' > /etc/ansible/hosts + + +ENV PATH /opt/ansible/bin:$PATH +ENV PYTHONPATH /opt/ansible/lib:$PYTHONPATH +ENV MANPATH /opt/ansible/docs/man:$MANPATH + + +COPY ansible-playbook-wrapper /usr/local/bin/ + +ONBUILD RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ + echo "===> Updating TLS certificates..." && \ + apt-get install -y openssl ca-certificates + +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" ] diff --git a/master-ubuntu16.04-onbuild/ansible-playbook-wrapper b/master-ubuntu16.04-onbuild/ansible-playbook-wrapper new file mode 100755 index 0000000..0ba45e6 --- /dev/null +++ b/master-ubuntu16.04-onbuild/ansible-playbook-wrapper @@ -0,0 +1,49 @@ +#!/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 diff --git a/master-ubuntu16.04/Dockerfile b/master-ubuntu16.04/Dockerfile new file mode 100644 index 0000000..921af23 --- /dev/null +++ b/master-ubuntu16.04/Dockerfile @@ -0,0 +1,62 @@ +# Dockerfile for building Ansible image from source for Ubuntu 16.04 (Xenial), with as few additional software as possible. +# +# @see http://docs.ansible.com/ansible/intro_installation.html#running-from-source +# +# Version 1.0 +# + + +# pull base image +FROM ubuntu:16.04 + +MAINTAINER William Yeh + + +RUN echo "===> Adding Ansible's prerequisites..." && \ + apt-get update -y && \ + DEBIAN_FRONTEND=noninteractive \ + apt-get install --no-install-recommends -y -q \ + build-essential \ + python-pip python-dev python-yaml \ + libffi-dev libssl-dev \ + libxml2-dev libxslt1-dev zlib1g-dev \ + git && \ + pip install --upgrade wheel setuptools && \ + pip install --upgrade pyyaml jinja2 pycrypto && \ + \ + \ + echo "===> Downloading Ansible's source tree..." && \ + git clone git://github.com/ansible/ansible.git --recursive && \ + \ + \ + echo "===> Compiling Ansible..." && \ + cd ansible && \ + bash -c 'source ./hacking/env-setup' && \ + \ + \ + echo "===> Moving useful Ansible stuff to /opt/ansible ..." && \ + mkdir -p /opt/ansible && \ + mv /ansible/bin /opt/ansible/bin && \ + mv /ansible/lib /opt/ansible/lib && \ + mv /ansible/docs /opt/ansible/docs && \ + rm -rf /ansible && \ + \ + \ + echo "===> Clean up..." && \ + apt-get remove -y --auto-remove \ + build-essential python-pip python-dev git libffi-dev libssl-dev && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* && \ + \ + \ + echo "===> Adding hosts for convenience..." && \ + mkdir -p /etc/ansible && \ + echo 'localhost' > /etc/ansible/hosts + + +ENV PATH /opt/ansible/bin:$PATH +ENV PYTHONPATH /opt/ansible/lib:$PYTHONPATH +ENV MANPATH /opt/ansible/docs/man:$MANPATH + +# default command: display Ansible version +CMD [ "ansible-playbook", "--version" ] diff --git a/ubuntu16.04-onbuild/Dockerfile b/ubuntu16.04-onbuild/Dockerfile new file mode 100644 index 0000000..cc28d8c --- /dev/null +++ b/ubuntu16.04-onbuild/Dockerfile @@ -0,0 +1,45 @@ +# Dockerfile for building Ansible image for Ubuntu 16.04 (Xenial), with as few additional software as possible. +# +# @see https://launchpad.net/~ansible/+archive/ubuntu/ansible +# +# Version 1.0 +# + + +# pull base image +FROM ubuntu:16.04 + +MAINTAINER William Yeh + + +RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ + \ + \ + echo "===> Installing Ansible..." && \ + apt-get install -y ansible && \ + \ + \ + echo "===> Clean up..." && \ + rm -rf /var/lib/apt/lists/* && \ + \ + \ + echo "===> Adding hosts for convenience..." && \ + echo 'localhost' > /etc/ansible/hosts + + +COPY ansible-playbook-wrapper /usr/local/bin/ + +ONBUILD RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ + echo "===> Updating TLS certificates..." && \ + apt-get install -y openssl ca-certificates + +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" ] diff --git a/ubuntu16.04-onbuild/ansible-playbook-wrapper b/ubuntu16.04-onbuild/ansible-playbook-wrapper new file mode 100755 index 0000000..0ba45e6 --- /dev/null +++ b/ubuntu16.04-onbuild/ansible-playbook-wrapper @@ -0,0 +1,49 @@ +#!/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 diff --git a/ubuntu16.04/Dockerfile b/ubuntu16.04/Dockerfile new file mode 100644 index 0000000..cd27d3a --- /dev/null +++ b/ubuntu16.04/Dockerfile @@ -0,0 +1,30 @@ +# Dockerfile for building Ansible image for Ubuntu 16.04 (Xenial), with as few additional software as possible. +# +# @see https://launchpad.net/~ansible/+archive/ubuntu/ansible +# +# Version 1.0 +# + + +# pull base image +FROM ubuntu:16.04 + +MAINTAINER William Yeh + +RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ + \ + \ + echo "===> Installing Ansible..." && \ + apt-get install -y ansible && \ + \ + \ + echo "===> Clean up..." && \ + rm -rf /var/lib/apt/lists/* && \ + \ + \ + echo "===> Adding hosts for convenience..." && \ + echo 'localhost' > /etc/ansible/hosts + + +# default command: display Ansible version +CMD [ "ansible-playbook", "--version" ] -- cgit v1.2.3