-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathDockerfile
49 lines (40 loc) · 2.08 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
# Example docker command to run install script
# docker run --env-file aws_envs \
# -v "$PWD/.terraform:/data-center-terraform/.terraform" \
# -v "$PWD/logs:/data-center-terraform/logs" \
# -v "$PWD/config.tfvars:/data-center-terraform/config.tfvars" \
# -it atlassianlabs/terraform ./install.sh -c config.tfvars
#
# Example docker command to collect k8s logs
# docker run --env-file aws_envs \
# -v "$PWD/k8s_logs:/data-center-terraform/k8s_logs" \
# -v "$PWD/logs:/data-center-terraform/logs" \
# -it atlassianlabs/terraform ./scripts/collect_k8s_logs.sh atlas-cluster-name-cluster us-east-2 k8s_logs
# Example docker command to run uninstall script
# docker run --env-file aws_envs \
# -v "$PWD/.terraform:/data-center-terraform/.terraform" \
# -v "$PWD/logs:/data-center-terraform/logs" \
# -v "$PWD/config.tfvars:/data-center-terraform/config.tfvars" \
# -it atlassianlabs/terraform ./uninstall.sh -t -c config.tfvars
# In those example aws_envs should contain AWS variables needed for authorization without quotes like:
# AWS_ACCESS_KEY_ID=123dsa321asd
# AWS_SECRET_ACCESS_KEY=asd123asd123
ARG BASE_IMAGE=ubuntu:22.04
FROM $BASE_IMAGE
RUN apt-get update \
&& apt-get install -y gnupg software-properties-common curl unzip openjdk-17-jdk python3 python3-pip \
&& python3 -m pip install --upgrade pip \
&& pip3 install boto3 retry \
&& curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - \
&& apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" \
&& apt-get update && apt-get install -y terraform jq
RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 \
&& chmod 700 get_helm.sh \
&& ./get_helm.sh
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \
&& unzip awscliv2.zip \
&& ./aws/install
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" \
&& install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
COPY . /data-center-terraform
WORKDIR /data-center-terraform