forked from fugue/regula-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (29 loc) · 1.28 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
# Container image that runs your code
FROM debian:jessie
# Install a number of dependencies using apt.
RUN apt-get update && apt-get install -y curl jq unzip
# Install OPA.
ARG OPA_VERSION=0.15.1
RUN curl -Lo '/usr/local/bin/opa' \
"https://github.com/open-policy-agent/opa/releases/download/v${OPA_VERSION}/opa_linux_amd64" &&\
chmod +x '/usr/local/bin/opa'
# Install terraform.
ARG TERRAFORM_VERSION=0.12.20
ENV TF_IN_AUTOMATION=true
RUN curl -Lo "/tmp/terraform-${TERRAFORM_VERSION}.zip" \
"https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip" && \
unzip -d '/usr/local/bin' "/tmp/terraform-${TERRAFORM_VERSION}.zip"
# Pre-install the `aws` terraform provider.
RUN mkdir /tmp/terraform-aws && \
echo 'provider "aws" {}' >/tmp/terraform-aws/main.tf && \
terraform get /tmp/terraform-aws && \
rm -rf /tmp/terraform-aws
# Install regula script and libraries.
ARG REGULA_VERSION=v0.5.0
RUN mkdir -p /opt/regula && \
curl -L "https://github.com/fugue/regula/archive/${REGULA_VERSION}.tar.gz" | \
tar -xz --strip-components=1 -C /opt/regula/
# Code file to execute when the docker container starts up (`entrypoint.sh`)
COPY entrypoint.sh /entrypoint.sh
ENV HOME=/root
ENTRYPOINT ["/entrypoint.sh"]