]>
Commit | Line | Data |
---|---|---|
ae06b63d WY |
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 | |
de4433f3 | 10 | FROM alpine:3.3 |
ae06b63d WY |
11 | |
12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | |
13 | ||
14 | ||
15 | RUN echo "===> Adding Python runtime..." && \ | |
97d48efe WY |
16 | apk --update add python py-pip openssl ca-certificates && \ |
17 | apk --update add --virtual build-dependencies \ | |
18 | python-dev libffi-dev openssl-dev build-base && \ | |
19 | pip install --upgrade pip cffi && \ | |
ae06b63d WY |
20 | \ |
21 | \ | |
22 | echo "===> Installing Ansible..." && \ | |
23 | pip install ansible && \ | |
24 | \ | |
25 | \ | |
26 | echo "===> Removing package list..." && \ | |
27 | apk del build-dependencies && \ | |
28 | rm -rf /var/cache/apk/* && \ | |
29 | \ | |
30 | \ | |
31 | echo "===> Adding hosts for convenience..." && \ | |
32 | mkdir -p /etc/ansible && \ | |
7b2618d5 | 33 | echo 'localhost' > /etc/ansible/hosts |
ae06b63d WY |
34 | |
35 | ||
36 | COPY ansible-playbook-wrapper /usr/local/bin/ | |
37 | ||
de8aece8 JC |
38 | ONBUILD RUN echo "===> Updating TLS certificates..." && \ |
39 | apk --update add openssl ca-certificates | |
ae06b63d WY |
40 | |
41 | ONBUILD WORKDIR /tmp | |
42 | ONBUILD COPY . /tmp | |
43 | ONBUILD RUN \ | |
44 | echo "===> Diagnosis: host information..." && \ | |
45 | ansible -c local -m setup all | |
46 | ||
47 | ||
48 | ||
49 | # default command: display Ansible version | |
50 | CMD [ "ansible-playbook", "--version" ] |