-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
68 lines (47 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
ARG TERRAFORM_VERSION=1.5.5
ARG TERRAGRUNT_VERSION=0.52.7
ARG AZ_VERSION=2.51.0
FROM hashicorp/terraform:${TERRAFORM_VERSION}
# 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}
## Set label for Azure DevOps Pipelines
LABEL "com.azure.dev.pipelines.agent.handler.node.path"="/usr/bin/node"
## Adjust WORKDIR and remove ENTRYPOINT FROM base image
WORKDIR ${HOME}
ENTRYPOINT []
## Set the default command
CMD ["/usr/local/bin/terragrunt"]