-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
56 lines (46 loc) · 1.37 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
FROM node:12.18.3-alpine3.9
RUN \
# apk add installs the following
apk add \
curl \
python \
py-pip \
py-boto \
py-dateutil \
py-httplib2 \
py-jinja2 \
py-paramiko \
py-setuptools \
py-yaml \
openssh-client \
bash \
tar && \
pip install --upgrade pip
# Makes the Ansible directories
RUN mkdir /etc/ansible /ansible
RUN mkdir ~/.ssh
# Over rides SSH Hosts Checking
RUN echo "host *" >> ~/.ssh/config &&\
echo "StrictHostKeyChecking no" >> ~/.ssh/config
# Downloads the Ansible tar (curl) and saves it and extract it (-o)
RUN \
curl -fsSL https://releases.ansible.com/ansible/ansible-2.9.3.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
# Makes a directory for ansible playbooks
RUN mkdir -p /ansible/playbooks
# Makes the playbooks directory the working directory
WORKDIR /ansible/playbooks
COPY package.json .
COPY yarn.lock .
RUN yarn && rm package.json && rm yarn.lock
# Sets environment variables
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 PATH /ansible/bin:$PATH
ENV PYTHONPATH /ansible/lib
# Sets entry point (same as running ansible-playbook)
ENTRYPOINT ["ansible-playbook"]