-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
67 lines (63 loc) · 1.74 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
FROM alpine:3.12
# see https://ruleoftech.com/2017/dockerizing-all-the-things-running-ansible-inside-docker-container
ENV ANSIBLE_VERSION "6.2.0"
ENV BUILD_PACKAGES \
bash \
curl \
tar \
openssh-client \
sshpass \
git \
python3 \
py3-boto \
py3-dateutil \
py3-httplib2 \
py3-jinja2 \
py3-paramiko \
py3-pip \
py3-yaml \
ca-certificates
RUN set -x && \
\
echo "==> Adding build-dependencies..." && \
apk --update add --virtual build-dependencies \
gcc \
musl-dev \
libffi-dev \
openssl-dev \
python3-dev && \
\
echo "==> Upgrading apk and system..." && \
apk update && apk upgrade && \
\
echo "==> Adding Python runtime..." && \
apk add --no-cache ${BUILD_PACKAGES} && \
pip3 install --upgrade pip && \
pip3 install python-keyczar docker && \
\
echo "==> Installing Ansible..." && \
pip3 install ansible==${ANSIBLE_VERSION} && \
\
echo "==> Cleaning up..." && \
apk del build-dependencies && \
rm -rf /var/cache/apk/* && \
\
echo "==> Adding hosts for convenience..." && \
mkdir -p /etc/ansible /ansible && \
echo "[local]" >> /etc/ansible/hosts && \
echo "localhost" >> /etc/ansible/hosts
RUN mkdir -p /2installOnHost
COPY scripts/ /2installOnHost/
RUN mkdir -p /2InstallOnHost/Example
COPY example/ /2InstallOnHost/Example
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 PYTHONPATH /ansible/lib
ENV PATH /ansible/bin:$PATH
ENV ANSIBLE_LIBRARY /ansible/library
# ansible prompt
ENV PS1="\[\e[0;33m\]\u@ansible-helper [ \[\e[0m\]\w\[\e[0;33m\] ]# \[\e[0m\]"
WORKDIR /ansible/playbooks