Skip to content

Commit

Permalink
Merge pull request #8 from deftdevs/terragrunt
Browse files Browse the repository at this point in the history
Add Terragrunt image
  • Loading branch information
pathob authored Dec 12, 2023
2 parents 2a8ad85 + 30f1cba commit 1f28213
Show file tree
Hide file tree
Showing 3 changed files with 489 additions and 0 deletions.
67 changes: 67 additions & 0 deletions terragrunt/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
ARG TERRAGRUNT_VERSION=0.52.7
ARG AZ_VERSION=2.51.0

FROM hashicorp/terraform:1.5.5

LABEL org.opencontainers.image.source https://github.com/deftdevs/containers
## Set label with node path for Azure DevOps Pipelines
LABEL com.azure.dev.pipelines.agent.handler.node.path /usr/bin/node

## Create a user and group

ARG USER="terraform"
ARG UID="1000"
ARG GROUP="${USER}"
ARG GID="${UID}"

RUN addgroup -g ${GID} -S ${GROUP} && \
adduser -u ${UID} -S ${USER} -G ${GROUP}

## Set the home directory

ARG HOME="/${USER}"
ENV HOME="${HOME}"

RUN mkdir -p ${HOME} && \
chown ${USER}:${GROUP} ${HOME}

## Install packages

RUN apk add --no-cache \
ansible \
bash \
cargo \
gcc \
libffi-dev \
make \
musl-dev \
nodejs \
openssl-dev \
postgresql \
py3-pip \
python3-dev \
shadow \
sudo

ARG AZ_VERSION

RUN pip install --upgrade pip \
&& pip install -Iv azure-cli==${AZ_VERSION}

## Install Terragrunt

ARG TERRAGRUNT_VERSION

RUN wget "https://github.com/gruntwork-io/terragrunt/releases/download/v${TERRAGRUNT_VERSION}/terragrunt_linux_amd64" -O /usr/local/bin/terragrunt --no-verbose \
&& chmod +x /usr/local/bin/terragrunt

USER ${USER}

## Adjust WORKDIR and remove ENTRYPOINT FROM base image

WORKDIR ${HOME}
ENTRYPOINT []

## Set the default command

CMD ["/usr/local/bin/terragrunt"]
Loading

0 comments on commit 1f28213

Please sign in to comment.