-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
82 lines (65 loc) · 3.04 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Dockerfile for building Ansible image for Alpine 3, with as few additional software as possible.
#
# @see https://github.com/gliderlabs/docker-alpine/blob/master/docs/usage.md
#
# Version 1.0
#
# pull base image
FROM alpine:3.6
MAINTAINER Marcel Juhnke <[email protected]>
#forked from williamyeh/ansible William Yeh <[email protected]>
ENV TERRAFORM_VERSION=0.11.1
ENV TERRAFORM_SHA256SUM=4e3d5e4c6a267e31e9f95d4c1b00f5a7be5a319698f0370825b459cb786e2f35
ENV PACKER_VERSION=1.1.1
ENV PACKER_SHA256SUM=e407566e2063ac697e0bbf6f2dd334be448d58bed93f44a186408bf1fc54c552
ENV GOVC_VERSION=v0.15.0
ENV KUBECTL_VERSION=v1.9.0
RUN echo "===> Installing sudo to emulate normal OS behavior..." && \
apk --update add sudo && \
\
\
echo "===> Adding Python runtime..." && \
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..." && \
pip install ansible==2.3.2.0 && \
\
\
echo "===> Installing handy tools (not absolutely required)..." && \
pip install --upgrade pywinrm && \
apk --update add sshpass openssh-client rsync && \
\
\
echo "===> Removing package list..." && \
apk del build-dependencies && \
rm -rf /var/cache/apk/* && \
\
\
echo "===> Adding hosts for convenience..." && \
mkdir -p /etc/ansible && \
echo 'localhost' > /etc/ansible/hosts
RUN apk add --update git curl openssh && \
curl https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip > terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
echo "${TERRAFORM_SHA256SUM} terraform_${TERRAFORM_VERSION}_linux_amd64.zip" > terraform_${TERRAFORM_VERSION}_SHA256SUMS && \
sha256sum -cs terraform_${TERRAFORM_VERSION}_SHA256SUMS && \
unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip -d /bin && \
rm -f terraform_${TERRAFORM_VERSION}_linux_amd64.zip
RUN apk add --update jq
ADD https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip ./
ADD https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_SHA256SUMS ./
RUN sed -i '/.*linux_amd64.zip/!d' packer_${PACKER_VERSION}_SHA256SUMS
RUN sha256sum -cs packer_${PACKER_VERSION}_SHA256SUMS
RUN unzip packer_${PACKER_VERSION}_linux_amd64.zip -d /bin
RUN rm -f packer_${PACKER_VERSION}_linux_amd64.zip
ADD https://github.com/vmware/govmomi/releases/download/${GOVC_VERSION}/govc_linux_386.gz ./
RUN gunzip govc_linux_386.gz
RUN mv govc_linux_386 /bin/govc
RUN chmod +x /bin/govc
ADD https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl /bin
RUN chmod +x /bin/kubectl
# default command: display Ansible version
CMD [ "ansible-playbook", "--version" ]