-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
51 lines (40 loc) · 1.62 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
FROM --platform=linux/amd64 ubuntu:22.04
ARG USER
ARG UID
ARG TF_VERSION=1.7.5
ARG GCLOUD_PATH=/usr/local
WORKDIR /workdir
RUN useradd -m -u "${UID}" "${USER}"
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
bash \
ca-certificates \
curl \
git \
jq \
wget \
unzip \
sudo \
apt-transport-https \
gnupg \
lsb-release \
&& rm -rf /var/lib/apt/lists/*
# Install terraform
RUN curl -sL -o terraform_${TF_VERSION}_linux_amd64.zip https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_linux_amd64.zip \
&& unzip terraform_${TF_VERSION}_linux_amd64.zip \
&& mv terraform /bin/terraform \
&& rm -rf terraform_${TF_VERSION}_linux_amd64.zip
# Install Task
RUN sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /bin
# Install GCloud SDK
RUN curl -sSL https://sdk.cloud.google.com | bash -s -- --disable-prompts --install-dir="${GCLOUD_PATH}"
ENV PATH $PATH:"${GCLOUD_PATH}"/google-cloud-sdk/bin
# Install Trivy
RUN curl -sSL https://aquasecurity.github.io/trivy-repo/deb/public.key | gpg --dearmor | sudo tee /usr/share/keyrings/trivy.gpg > /dev/null \
&& echo "deb [signed-by=/usr/share/keyrings/trivy.gpg] https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main" | sudo tee -a /etc/apt/sources.list.d/trivy.list \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
trivy
# Install Infracost
RUN curl -fsSL https://raw.githubusercontent.com/infracost/infracost/master/scripts/install.sh | sh
USER "${USER}"
HEALTHCHECK CMD terraform --version && gcloud --version