How to Fix terraform version in Base Image

How can we set a fixed Terraform version so that it is already available in the base image and does not need to be downloaded repeatedly?

@robingoyal

Could you please share the lab link or the KKE level and task name? I’ll check it.

hi @raymond.baoly

We want to restrict Terraform downloads within our project’s Docker image. Currently, Terraform downloads the required providers every time a pipeline is triggered, which causes unnecessary overhead and external internet dependency.

Our goal is to package the required Terraform binary and provider plugins inside the Docker image so that Terraform always uses the pre-downloaded versions locally, without reaching out to the internet.

Please advise on the best way to configure this setup so that pipelines consistently use the locally available Terraform components.

I don’t have any lab link , it’s in my current project.

Hi @robingoyal

Please try to refer this way https://stackoverflow.com/questions/50944395/use-pre-installed-terraform-plugins-instead-of-downloading-them-with-terraform-i

hi @raymond.baoly ,

i was ablet to fix this in my local but how can i fix when docker is running in the server in the live environment .

Hi @robingoyal

You need to identify which image the server is using, then find and update the Dockerfile to include the fixes you applied locally. After that, build and push the image to the registry, and update the server to use the new image tag.