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

tf-runner Docker uses Hashicorp Terraform binaries? #1437

Open
cunningr opened this issue Sep 2, 2024 · 2 comments
Open

tf-runner Docker uses Hashicorp Terraform binaries? #1437

cunningr opened this issue Sep 2, 2024 · 2 comments

Comments

@cunningr
Copy link

cunningr commented Sep 2, 2024

I am not sure if this is really the right place however I am unable to join the Slack channel. Browsing the code here: https://github.com/flux-iac/tofu-controller/blob/main/runner.Dockerfile this kind of suggests that the runner for tofu-controller is still using Terraform binaries?

@xsvil
Copy link

xsvil commented Sep 5, 2024

@cunningr On my setup, I am literally renaming tofu to terraform so i can use OpenTofu at the end. This works already for months and is kind of a workaround since there's no controller option for it yet.

Dockerfile:

ARG BASE_IMAGE
FROM $BASE_IMAGE

ARG TARGETARCH
ARG TF_VERSION

USER root

ADD https://github.com/opentofu/opentofu/releases/download/v${TF_VERSION}/tofu_${TF_VERSION}_linux_${TARGETARCH}.zip /tofu_${TF_VERSION}_linux_${TARGETARCH}.zip
RUN unzip -q /tofu_${TF_VERSION}_linux_${TARGETARCH}.zip -d /usr/local/bin && \
    mv /usr/local/bin/tofu /usr/local/bin/terraform && \
    chmod +x /usr/local/bin/terraform && \
    rm /tofu_${TF_VERSION}_linux_${TARGETARCH}.zip

USER 65532:65532 

script.sh:

export TF_CONTROLLER_VERSION=v0.16.0-rc.3
export TF_VERSION=1.8.2
export REGISTRY_URL="example.org"
export BASE_IMAGE=ghcr.io/flux-iac/tf-runner:${TF_CONTROLLER_VERSION}-base
export TARGETARCH=arm64
export REMOTE_REPO=${REGISTRY_URL}/tf-runner:$TF_VERSION-tofu
docker buildx build \
    --build-arg BASE_IMAGE=${BASE_IMAGE} \
    --build-arg TARGETARCH=${TARGETARCH} \
    --build-arg TF_VERSION=${TF_VERSION} \
    --platform linux/$TARGETARCH \
    --tag $REMOTE_REPO \
    --push .

@ilithanos
Copy link
Collaborator

We are still running the hashicorp binary ( Last non-BSL licensed version ) for now, but moving the the tofu binary is part of the future plans for this controller. I can't give an eta on it currently, but building a custom runner image until then is defininently an option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants