-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathDockerfile
executable file
·66 lines (53 loc) · 2.44 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
# Dockerfile
# pull base image
FROM ubuntu:18.04
MAINTAINER William Yeh <[email protected]>
RUN echo "===> Adding Ansible's prerequisites..." && \
apt-get update -y && \
DEBIAN_FRONTEND=noninteractive \
apt-get install --no-install-recommends -y -q \
build-essential \
python python-pip python-dev \
libffi-dev libssl-dev \
libxml2-dev libxslt1-dev zlib1g-dev \
git && \
echo "--> Upgrading pip..." && \
python -m pip install --upgrade pip && \
pip install --upgrade setuptools wheel && \
pip install --upgrade pyyaml jinja2 pycrypto && \
pip install --upgrade pywinrm
RUN apt-get install software-properties-common -y && \
apt-add-repository ppa:ansible/ansible && \
apt-get update && \
apt-get install ansible -y
RUN DEBIAN_FRONTEND=noninteractive && \
apt-get install --no-install-recommends -y -q \
apt-transport-https ca-certificates curl gnupg-agent software-properties-common && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
apt-key fingerprint 0EBFCD88 && \
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" && \
apt-get update && \
apt-get install --no-install-recommends -y -q docker-ce docker-ce-cli containerd.io
RUN echo "===> Installing handy tools (not absolutely required)..." && \
apt-get install -y sshpass openssh-client && \
\
\
echo "===> Clean up..." && \
apt-get remove -y --auto-remove \
build-essential python-pip python-dev git libffi-dev libssl-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
\
\
echo "===> Adding hosts for convenience..." && \
mkdir -p /etc/ansible && \
echo 'localhost' > /etc/ansible/hosts
ENV PATH /opt/ansible/bin:$PATH
ENV PYTHONPATH /opt/ansible/lib:$PYTHONPATH
ENV MANPATH /opt/ansible/docs/man:$MANPATH
# default command: display Ansible version
CMD [ "ansible-playbook", "--version" ]
WORKDIR /app
COPY app/ .
RUN echo localhost > inventory
CMD [ "ansible-playbook", "--version" ]