/
Dockerfile
72 lines (61 loc) · 2.42 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
68
69
70
71
72
FROM python:3.9-slim-buster
ARG HELM_VERSION="3.5.1"
ARG TERRAFORM_VERSION="0.14.7"
ARG KUBECTL_VERSION="1.20.2"
ARG ANSIBLE_VERSION="3.0.0"
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
git \
wget \
unzip \
curl \
vim \
jq \
procps && \
apt-get clean -y && \
apt-get autoclean -y && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/apt/archives/*
RUN pip3 install --no-cache-dir \
boto \
boto3 \
kubernetes \
ansible==${ANSIBLE_VERSION} \
prettytable \
requests \
docker \
pyOpenSSL \
unittest2 \
colorama
WORKDIR /root/download
# Install aws cli
RUN wget "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -O "/root/download/awscli2.zip" && \
unzip awscli2.zip && \
./aws/install
# Install aws iam authenticator
RUN wget https://amazon-eks.s3.us-west-2.amazonaws.com/1.18.9/2020-11-02/bin/linux/amd64/aws-iam-authenticator -O /usr/local/bin/aws-iam-authenticator && \
chmod +x /usr/local/bin/aws-iam-authenticator
# Install helm
RUN mkdir helm3 && \
curl -SsL --retry 5 "https://get.helm.sh/helm-v$HELM_VERSION-linux-amd64.tar.gz" | tar xz -C ./helm3 && \
cp /root/download/helm3/linux-amd64/helm /usr/local/bin/helm
# Install terraform
RUN wget https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform\_${TERRAFORM_VERSION}\_linux_amd64.zip && \
unzip ./terraform\_${TERRAFORM_VERSION}\_linux_amd64.zip -d terraform14_cli && \
cp /root/download/terraform14_cli/terraform /usr/local/bin/terraform && \
wget https://storage.googleapis.com/kubernetes-release/release/v$KUBECTL_VERSION/bin/linux/amd64/kubectl -O /usr/local/bin/kubectl && \
chmod +x /usr/local/bin/kubectl && \
rm -rf /root/download/*
COPY root/ /root/
# Install the orc8r cli (orcl)
WORKDIR /root/scripts
RUN pip3 install .
# Set these environment variables to ensure aws configuration remains
# in the deployment directory even when container is removed
ENV AWS_CONFIG_FILE=/root/project/.aws/config
ENV AWS_SHARED_CREDENTIALS_FILE=/root/project/.aws/credentials
ENV AWS_DEFAULT_OUTPUT=json
WORKDIR /root/project
CMD ["/bin/bash"]