]> git.immae.eu Git - github/fretlink/docker-ansible.git/blob - alpine3-onbuild/Dockerfile
debian9: use "slim" version of debian image
[github/fretlink/docker-ansible.git] / alpine3-onbuild / Dockerfile
1 # Dockerfile for building Ansible image for Alpine 3, with as few additional software as possible.
2 #
3 # @see https://github.com/gliderlabs/docker-alpine/blob/master/docs/usage.md
4 #
5 # Version 1.0
6 #
7
8
9 # pull base image
10 FROM alpine:3.6
11
12 MAINTAINER William Yeh <william.pjyeh@gmail.com>
13
14
15 RUN echo "===> Installing sudo to emulate normal OS behavior..." && \
16 apk --update add sudo && \
17 \
18 \
19 echo "===> Adding Python runtime..." && \
20 apk --update add python py-pip openssl ca-certificates && \
21 apk --update add --virtual build-dependencies \
22 python-dev libffi-dev openssl-dev build-base && \
23 pip install --upgrade pip cffi && \
24 \
25 \
26 echo "===> Installing Ansible..." && \
27 pip install ansible && \
28 \
29 \
30 echo "===> Removing package list..." && \
31 apk del build-dependencies && \
32 rm -rf /var/cache/apk/* && \
33 \
34 \
35 echo "===> Adding hosts for convenience..." && \
36 mkdir -p /etc/ansible && \
37 echo 'localhost' > /etc/ansible/hosts
38
39
40 COPY ansible-playbook-wrapper /usr/local/bin/
41
42 ONBUILD RUN echo "===> Updating TLS certificates..." && \
43 apk --update add openssl ca-certificates
44
45 ONBUILD WORKDIR /tmp
46 ONBUILD COPY . /tmp
47 ONBUILD RUN \
48 echo "===> Diagnosis: host information..." && \
49 ansible -c local -m setup all
50
51
52
53 # default command: display Ansible version
54 CMD [ "ansible-playbook", "--version" ]