Skip to content

Commit 6f947a5

Browse files
Mikołaj Świątekswiatekm
authored andcommitted
chore: copy terraform from hashicorp docker image
1 parent e9e11fe commit 6f947a5

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

Dockerfile

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
FROM hashicorp/terraform:1.8.1 as terraform
2+
13
FROM alpine:3.19.1
24

3-
ENV TERRAFORM_VERSION=1.8.1
45
ENV COLLECTION_VERSION=v4.6.1
56
ENV MONITORS_VERSION=v1.2.4
67
ARG TARGETPLATFORM
@@ -11,21 +12,15 @@ RUN apk add --no-cache \
1112
jq \
1213
git \
1314
&& apk upgrade \
14-
&& if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then TERRAFORM_PLATFORM="linux_amd64"; fi; \
15-
if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then TERRAFORM_PLATFORM="linux_arm"; fi; \
16-
if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then TERRAFORM_PLATFORM="linux_arm64"; fi; \
17-
if [ "${TERRAFORM_PLATFORM}" = "" ]; then TERRAFORM_PLATFORM="${TARGETPLATFORM}"; fi \
18-
&& curl -o terraform.zip https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_${TERRAFORM_PLATFORM}.zip \
19-
&& unzip terraform.zip \
20-
&& mv terraform /usr/local/bin/ \
21-
&& rm terraform.zip \
2215
# ping group has a conflicting id: 999 so delete it
2316
&& delgroup ping \
2417
&& addgroup -g 999 setup \
2518
&& adduser -u 999 -D -G setup setup \
2619
&& mkdir /terraform /scripts /monitors \
2720
&& chown -R setup:setup /terraform /scripts /monitors
2821

22+
COPY --from=terraform /bin/terraform /usr/local/bin/terraform
23+
2924
USER setup
3025
RUN cd /terraform/ \
3126
&& curl -O https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/${COLLECTION_VERSION}/deploy/helm/sumologic/conf/setup/main.tf \

0 commit comments

Comments
 (0)