-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (29 loc) · 1.21 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
# This container image using to ensure proper versions and portability
# of required software
# A minimal Docker image based on Alpine Linux
# https://hub.docker.com/_/alpine/tags?name=3.17.0
FROM alpine:3.17.0 as build
ENV TF_VER 1.5.5
ENV TF_BASEURL https://releases.hashicorp.com/terraform
ENV TG_VER 0.52.3
ENV TG_BASEURL https://github.com/gruntwork-io/terragrunt/releases/download
WORKDIR /build
RUN apk add --no-cache --update curl \
&& curl -Lo terraform_${TF_VER}_SHA256SUMS \
${TF_BASEURL}/${TF_VER}/terraform_${TF_VER}_SHA256SUMS \
&& curl -Lo terraform_${TF_VER}_linux_amd64.zip \
${TF_BASEURL}/${TF_VER}/terraform_${TF_VER}_linux_amd64.zip \
&& sha256sum -c terraform_${TF_VER}_SHA256SUMS 2>&1 | \
grep terraform_${TF_VER}_linux_amd64.zip \
&& unzip terraform_${TF_VER}_linux_amd64.zip \
&& rm terraform_${TF_VER}_linux_amd64.zip terraform_${TF_VER}_SHA256SUMS \
&& curl -Lo terragrunt ${TG_BASEURL}/v${TG_VER}/terragrunt_linux_amd64 \
&& chmod +x terraform terragrunt
FROM alpine:3.17.0
ENV USER user
RUN addgroup -g 1000 -S ${USER} \
&& adduser -u 1000 -S ${USER} -G ${USER} -h /home/${USER}
COPY --from=build /build /usr/bin
RUN apk add --no-cache --update ansible
USER ${USER}
WORKDIR /code