This repository has been archived by the owner on Jan 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
81 lines (68 loc) · 2.71 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
73
74
75
76
77
78
79
80
81
FROM ubuntu:22.04
LABEL org.opencontainers.image.source https://github.com/liatrio/builder-images
ARG GO_VERSION=1.18.2
ARG YQ_VERSION=4.5.1
ARG TFLINT_VERSION=v0.39.3
ARG TERRAFORM_VERSION=1.2.8
ARG TERRAGRUNT_VERSION=v0.38.9
ENV PATH="$PATH:/usr/local/go/bin"
RUN apt-get update && apt-get install -yq \
apt-transport-https \
ca-certificates \
curl \
git \
gnupg \
jq \
lsb-release \
wget \
zip && \
rm -rf /var/lib/apt/lists/*
# Install yq
RUN cd /tmp && \
wget https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_amd64 && \
chmod +x yq_linux_amd64 && \
mv -vf yq_linux_amd64 /usr/local/bin/yq && \
yq -V
# Install azure cli
RUN curl -sL https://packages.microsoft.com/keys/microsoft.asc | \
gpg --dearmor | \
tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null && \
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" | \
tee /etc/apt/sources.list.d/azure-cli.list && \
apt-get update && apt-get install -yq azure-cli && \
rm -rf /var/lib/apt/lists/* && \
az extension add --system --name azure-devops && \
az -v
# Install go
RUN wget -O /tmp/go.tar.gz https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz && \
tar -C /usr/local -xzf /tmp/go.tar.gz && \
rm /tmp/go.tar.gz && \
go version
# Install tfenv and setup gpg verification
RUN mkdir /opt/tfenv && \
git clone https://github.com/tfutils/tfenv.git /opt/tfenv/.tfenv && \
chmod -R ago+w /opt/tfenv/ && \
echo 'PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/tfenv/.tfenv/bin"' > /etc/environment && \
touch /opt/tfenv/.tfenv/use-gnupg && \
curl https://keybase.io/hashicorp/pgp_keys.asc | gpg --import && \
echo 'curl https://keybase.io/hashicorp/pgp_keys.asc | gpg --import' >> /etc/skel/.profile
ENV PATH $PATH:/usr/local/go/bin:/opt/tfenv/.tfenv/bin
# Install terraform
RUN tfenv install ${TERRAFORM_VERSION} && \
tfenv use ${TERRAFORM_VERSION} && \
chmod -R ago+w /opt/tfenv/ && \
terraform version
# Install terragrunt
RUN wget -O /tmp/terragrunt_linux_amd64 https://github.com/gruntwork-io/terragrunt/releases/download/${TERRAGRUNT_VERSION}/terragrunt_linux_amd64 && \
mv /tmp/terragrunt_linux_amd64 /usr/bin/terragrunt && \
chmod +x /usr/bin/terragrunt && \
terragrunt --version
# Install tflint
RUN mkdir -p /opt/tflint && \
cd /opt/tflint && \
wget -O tflint.zip https://github.com/terraform-linters/tflint/releases/download/${TFLINT_VERSION}/tflint_linux_amd64.zip && \
unzip tflint.zip && \
chmod +x tflint && \
mv -vf tflint /usr/local/bin/tflint && \
rm -rf /opt/tflint && \
tflint -v