-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (25 loc) · 942 Bytes
/
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
# Use the latest Python Alpine image as the base
FROM python:alpine
# Install necessary dependencies
RUN apk --no-cache add \
curl \
unzip \
git \
bash
# Define Terraform version using an argument
ARG TERRAFORM_VERSION=1.1.0
# Download and install Terraform
RUN curl -fsSL https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip -o terraform.zip && \
unzip terraform.zip -d /usr/local/bin && \
rm terraform.zip
# Install Terraform Compliance using pip
RUN pip install --no-cache-dir terraform-compliance
# Set the working directory to /app
WORKDIR /app
# Set an environment variable for script options
ENV PLUGIN_ARGS=""
# Copy the script.sh file into /usr/local/bin/ and make it executable
COPY script.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/script.sh
# Set the entry point for the container to run script.sh
ENTRYPOINT ["/usr/local/bin/script.sh"]