Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: copy terraform from hashicorp docker image #99

Merged
merged 1 commit into from
May 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM hashicorp/terraform:1.8.1 as terraform

FROM alpine:3.19.1

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

COPY --from=terraform /bin/terraform /usr/local/bin/terraform

USER setup
RUN cd /terraform/ \
&& curl -O https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/${COLLECTION_VERSION}/deploy/helm/sumologic/conf/setup/main.tf \
Expand Down