forked from troykinsella/concourse-ansible-playbook-resource
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
44 lines (35 loc) · 992 Bytes
/
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
FROM ubuntu:bionic as main
RUN set -eux; \
apt-get update -y; \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
git \
openssh-client \
python3 \
python3-apt \
python3-pip \
rsync \
ruby \
wget; \
apt-get clean all; \
rm -rf /var/lib/apt/lists/*; \
pip3 install --no-cache-dir \
ansible \
PyVmomi \
pywinrm>=0.3.0 \
boto; \
mkdir -p /etc/ansible; \
echo -e "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts
COPY assets/ /opt/resource/
FROM main as testing
RUN set -eux; \
gem install \
rspec; \
wget -q -O - https://raw.githubusercontent.com/troykinsella/mockleton/master/install.sh | bash; \
cp /usr/local/bin/mockleton /usr/local/bin/ansible-galaxy; \
cp /usr/local/bin/mockleton /usr/local/bin/ansible-playbook; \
cp /usr/local/bin/mockleton /usr/bin/ssh-add;
COPY . /resource/
RUN set -eux; \
cd /resource; \
rspec
FROM main