47 lines
1.4 KiB
Docker
47 lines
1.4 KiB
Docker
# =============================================================================
|
|
# Terraform CI Image
|
|
#
|
|
# Image minimale Alpine pour les pipelines CI/CD Terraform
|
|
# Inclut : Terraform, tflint, git
|
|
# =============================================================================
|
|
|
|
FROM alpine:3.20
|
|
|
|
LABEL maintainer="Damien Arnodo"
|
|
LABEL description="Lightweight Terraform CI image with tflint for Gitea Actions"
|
|
|
|
# Versions des outils
|
|
ARG TERRAFORM_VERSION=1.5.7
|
|
ARG TFLINT_VERSION=0.54.0
|
|
|
|
# Installation des dépendances de base
|
|
RUN apk add --no-cache \
|
|
curl \
|
|
git \
|
|
bash \
|
|
jq \
|
|
unzip \
|
|
ca-certificates
|
|
|
|
# Installation de Terraform
|
|
RUN curl -sL "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip" -o /tmp/terraform.zip \
|
|
&& unzip /tmp/terraform.zip -d /usr/local/bin \
|
|
&& rm /tmp/terraform.zip \
|
|
&& chmod +x /usr/local/bin/terraform
|
|
|
|
# Installation de tflint
|
|
RUN curl -sL "https://github.com/terraform-linters/tflint/releases/download/v${TFLINT_VERSION}/tflint_linux_amd64.zip" -o /tmp/tflint.zip \
|
|
&& unzip /tmp/tflint.zip -d /usr/local/bin \
|
|
&& rm /tmp/tflint.zip \
|
|
&& chmod +x /usr/local/bin/tflint
|
|
|
|
# Nettoyage pour réduire la taille
|
|
RUN rm -rf /var/cache/apk/* /tmp/*
|
|
|
|
# Vérification des versions
|
|
RUN terraform version && tflint --version
|
|
|
|
WORKDIR /workspace
|
|
|
|
CMD ["/bin/bash"]
|