-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
43 lines (39 loc) · 1.32 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
# ===============================================
# AWS CLI v2 + Ansible + Terraform
# For deploying and maintaining AWS infrastructure from Gitlab CI pipelines
# ===============================================
FROM dandersonacro/gitlabci-awscli:latest
MAINTAINER Dale Anderson (http://www.acromedia.com/)
# ----------------
# Get everything up to date
# ----------------
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \
&& apt-get -y upgrade \
&& apt-get install -y --no-install-recommends \
python3-pip \
locales \
software-properties-common \
sshpass \
openssh-client \
rsync \
&& rm -rfv /var/lib/apt/lists/*
# ----------------
# Install Ansible
# ----------------
RUN python3 -m pip install ansible boto3 botocore \
&& mkdir -pv /etc/ansible/ \
&& echo 'localhost' > /etc/ansible/hosts
# ----------------
# Install Terraform
# ----------------
RUN wget --quiet https://releases.hashicorp.com/terraform/1.4.6/terraform_1.4.6_linux_amd64.zip \
&& unzip -qq terraform_1.4.6_linux_amd64.zip \
&& mv terraform /usr/local/bin/ \
&& rm terraform_1.4.6_linux_amd64.zip
# ----------------
# Default command: Display versions
# ----------------
CMD [ "/bin/bash", "-c", "(set -x && aws --version; ansible --version; terraform --version)" ]