forked from chandnipatelTW/basic-aws-infrastructure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
50 lines (39 loc) · 1.85 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
FROM alpine:3.9
ENV TERRAFORM_SHA256SUM=9b9a4492738c69077b079e595f5b2a9ef1bc4e8fb5596610f69a6f322a8af8dd
ENV TERRAFORM_VERSION=0.11.14
ENV PACKER_SHA256SUM=258d1baa23498932baede9b40f2eca4ac363b86b32487b36f48f5102630e9fbb
ENV PACKER_VERSION=1.2.4
# Common dependencies
RUN apk add --no-cache \
curl \
python2 \
py2-pip \
jq \
bash \
make \
openssh
# Install terraform
RUN curl https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip > terraform_${TERRAFORM_VERSION}_linux_amd64.zip \
&& echo "${TERRAFORM_SHA256SUM} terraform_${TERRAFORM_VERSION}_linux_amd64.zip" > terraform_${TERRAFORM_VERSION}_SHA256SUMS && sha256sum -cs terraform_${TERRAFORM_VERSION}_SHA256SUMS \
&& unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip -d /usr/bin \
&& rm -f terraform_${TERRAFORM_VERSION}_linux_amd64.zip \
&& rm -f terraform_${TERRAFORM_VERSION}_SHA256SUMS
# Install packer
RUN curl https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip > packer_${PACKER_VERSION}_linux_amd64.zip \
&& echo "${PACKER_SHA256SUM} packer_${PACKER_VERSION}_linux_amd64.zip" > packer_${PACKER_VERSION}_SHA256SUMS && sha256sum -cs packer_${PACKER_VERSION}_SHA256SUMS \
&& unzip packer_${PACKER_VERSION}_linux_amd64.zip -d /usr/bin \
&& rm -f packer_${PACKER_VERSION}_linux_amd64.zipj \
&& rm -f terraform_${PACKER_VERSION}_SHA256SUMS
# Install cfssl
RUN apk add --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ cfssl
# Install AWS and Okta tooling
RUN pip install virtualenv
RUN virtualenv /okta_venv \
&& source /okta_venv/bin/activate \
&& pip install \
"aws_role_credentials>=0.6.3" \
"oktaauth>=0.2" \
"awscli>=1.15"
RUN mkdir /project
WORKDIR /project
ENTRYPOINT ["/bin/bash"]