-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
66 lines (54 loc) · 1.92 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
FROM gliderlabs/alpine:3.9
ARG BUILD_DATE
ARG VCS_REF
LABEL maintainer="OneOffTech <[email protected]>" \
org.label-schema.name="oneofftech/ansible-keepass" \
org.label-schema.description="Opinionated Ansible Docker image with Keepass to manage provision and deployments" \
org.label-schema.schema-version="1.0" \
org.label-schema.vcs-url="https://github.com/OneOffTech/docker-ansible-keepass"
RUN apk-install --no-cache \
bash \
curl \
build-base \
openssl-dev \
libffi-dev \
python-dev \
openssh-client \
libxml2 \
libxml2-dev \
libxslt-dev \
python \
py-boto \
py-dateutil \
py-httplib2 \
py-jinja2 \
py-paramiko \
py-pip \
py-setuptools \
py-yaml \
tar \
&& pip install --upgrade python-keyczar pykeepass \
&& rm -rf /var/cache/apk/* \
# While we wait for Pip 20.1 with cache purge command to be available https://github.com/pypa/pip/issues/4685
&& rm -rf ~/.cache/pip/* /root/.cache/pip/*
RUN mkdir /etc/ansible/ /ansible /ansible/playbooks && \
echo "[local]" >> /etc/ansible/hosts && \
echo "localhost" >> /etc/ansible/hosts
ENV ANSIBLE_VERSION=2.9.7
RUN \
curl -fsSL https://github.com/ansible/ansible/archive/v${ANSIBLE_VERSION}.tar.gz -o ansible.tar.gz && \
tar -xzf ansible.tar.gz -C ansible --strip-components 1 && \
rm -fr ansible.tar.gz /ansible/docs /ansible/examples /ansible/packaging /ansible/changelogs /ansible/test
WORKDIR /ansible/playbooks
ADD ./files /ansible/playbooks
ENV ANSIBLE_GATHERING smart
ENV ANSIBLE_HOST_KEY_CHECKING false
ENV ANSIBLE_RETRY_FILES_ENABLED false
ENV ANSIBLE_ROLES_PATH /ansible/playbooks/roles
ENV ANSIBLE_SSH_PIPELINING True
ENV ANSIBLE_LOOKUP_PLUGINS /ansible/playbooks/lookup_plugins
ENV PATH /ansible/bin:$PATH
ENV PYTHONPATH /ansible/lib
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-ref=$VCS_REF
ENTRYPOINT ["/bin/bash", "./ansible-playbook-wrapper"]