-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (32 loc) · 1.39 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
FROM ghcr.io/dockhippie/golang:1.23 as build
# renovate: datasource=github-releases depName=gruntwork-io/terragrunt
ENV TERRAGRUNT_VERSION=0.72.3
# renovate: datasource=github-releases depName=hashicorp/terraform
ENV TERRAFORM_VERSION=1.10.4
ARG TARGETARCH
RUN apk add -U unzip && \
case "${TARGETARCH}" in \
'amd64') \
curl -sSLo /tmp/terraform.zip https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip; \
;; \
'arm64') \
curl -sSLo /tmp/terraform.zip https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_arm64.zip; \
;; \
'arm') \
curl -sSLo /tmp/terraform.zip https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_arm.zip; \
;; \
*) echo >&2 "error: unsupported architecture '${TARGETARCH}'"; exit 1 ;; \
esac && \
cd /tmp && \
unzip terraform.zip
RUN git clone -b v${TERRAGRUNT_VERSION} https://github.com/gruntwork-io/terragrunt.git /srv/app/src && \
cd /srv/app/src && \
GO111MODULE=on go install -ldflags "-X main.version=$(git describe --tags --abbrev=12)" .
FROM ghcr.io/dockhippie/alpine:3.20
ENTRYPOINT [""]
RUN apk update && \
apk upgrade && \
apk add gnupg git && \
rm -rf /var/cache/apk/*
COPY --from=build /srv/app/bin/terragrunt /usr/bin/
COPY --from=build /tmp/terraform /usr/bin/