-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
72 lines (58 loc) · 2.66 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 ubuntu:20.04
ARG TERRAFORM_VERSION=1.1.8
ARG K8S_VERSION=v1.24.6
ARG HELM_VERSION=v3.11.0
ARG HELM_FILENAME=helm-${HELM_VERSION}-linux-amd64.tar.gz
ARG KUBESPRAY_VERSION=2.20.0
ARG NEWMAN_VERSION=5.0.0
ARG TERRAGRUNT_VERSION=0.36.7
# Update apt and Install dependencies
RUN apt-get update && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y \
tzdata \
curl \
dnsutils \
git \
jq \
libssl-dev \
openvpn \
python3 \
python3-pip \
screen \
vim \
wget \
zip \
mysql-client \
make \
&& rm -rf /var/lib/apt/lists/*
# Install tools and configure the environment
RUN wget -q https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip -O /tmp/terraform_${TERRAFORM_VERSION}_linux_amd64.zip \
&& unzip /tmp/terraform_${TERRAFORM_VERSION}_linux_amd64.zip -d /bin/ \
&& rm /tmp/terraform_${TERRAFORM_VERSION}_linux_amd64.zip
RUN wget -q https://github.com/gruntwork-io/terragrunt/releases/download/v${TERRAGRUNT_VERSION}/terragrunt_linux_amd64 -O /bin/terragrunt \
&& chmod +x /bin/terragrunt
RUN wget -q https://github.com/kubernetes-sigs/kubespray/archive/v${KUBESPRAY_VERSION}.tar.gz \
&& tar zxvf v${KUBESPRAY_VERSION}.tar.gz \
&& ln -sf kubespray-${KUBESPRAY_VERSION} kubespray \
&& rm v${KUBESPRAY_VERSION}.tar.gz
RUN wget -q https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl -O /usr/local/bin/kubectl && \
chmod +x /usr/local/bin/kubectl
RUN wget -q -O- https://get.helm.sh/${HELM_FILENAME} | tar xz && \
mv linux-amd64/helm /bin/helm && \
rm -rf linux-amd64
#install newman
RUN curl -sL https://deb.nodesource.com/setup_15.x | bash - && apt-get install -y nodejs && npm install -g newman@${NEWMAN_VERSION} && npm install -g newman-reporter-html
RUN cd kubespray && python3 -m pip install -r requirements.txt
# COPY kubespray-requirements.txt requirements.txt
# RUN python3 -m pip install -r requirements.txt
RUN pip3 install --upgrade pip \
&& mkdir /workdir && cd /workdir \
&& mkdir keys \
&& python3 -m pip install netaddr awscli
RUN pip3 install "openshift>=0.6" "setuptools>=40.3.0" \
&& ansible-galaxy collection install community.kubernetes
RUN pip3 install "openshift>=0.6" "setuptools>=40.3.0"
RUN wget -q -O- https://dl.google.com/go/go1.19.4.linux-amd64.tar.gz | tar xz && \
mv go /usr/local/go-1.19 && \
export GOROOT=/usr/local/go-1.19 && export PATH=$GOROOT/bin:$PATH && \
wget -q -O- https://github.com/jrhouston/tfk8s/archive/refs/tags/v0.1.10.tar.gz | tar xz && cd tfk8s-0.1.10 && export PATH=$PATH:$(go env GOPATH)/bin && make install
COPY . iac-run-dir