Terraform: Release additional architectures for docker images

Created on 14 Jul 2020  路  2Comments  路  Source: hashicorp/terraform

Current Terraform Version

...

Use-cases


Currently, I believe that only amd64 docker images are available. It would be nice if there were some more architectures available especially armv6 and armv7. There's a lot of arm based devices now such as the Raspberry Pi, Pinebook, etc, and it would be nice if I could pull a Terraform docker image for their respective architecture.

Attempted Solutions

Proposal

I think there's a couple different ways that this problem could be approached. For one, I believe TravisCI makes different architectures available, and more recently GitHub runners are available for arm. One could build the images using those methods. I'm not too familiar with the second option, but another option might be to use docker buildx.

References

build enhancement

Most helpful comment

Hi @jlosito! Thanks for sharing this feature request.

In the very near future we don't plan to change the available docker images, but this could perhaps come eventually. We focus mainly on the normal archive releases on releases.hashicorp.com and the docker images are there as a convenience but we don't have the resources on our team to maintain an increasingly-large surface area of official distribution channels at this time.

In the meantime, you could potentially take the Dockerfile we use to produce the existing "light" images and adapt it to work with a different architecture:

  • change the base image from alpine:latest to a similar base image for the architecure you want
  • change the archive URL template to say e.g. linux_arm instead of linux_amd64
  • change the other later references to the filenames containing linux_amd64 to be e.g. linux_arm instead

With that said, there are currently no official Terraform release packages for linux_arm64, so the above strategy will work only for 32-bit ARM at the moment. 64-bit ARM support is likely to come eventually -- I would expect it to come before docker image support on any other architectures, because the base releases are a prerequisite for the docker images -- but again, we don't have any firm plans to add other architectures at this time.

It's also worth considering that running Terraform in Docker is not as relevant as running some other software, because it's a statically-linked executable with no dependencies other than the Linux kernel system call interface. Therefore if you have an executable built for the architecture in question (either one of our official builds or your own build from source code) then it should be relatively straightforward to run it directly on one of the ARM-based devices you mentioned, without introducing the complexity of Docker.

All 2 comments

Hi @jlosito! Thanks for sharing this feature request.

In the very near future we don't plan to change the available docker images, but this could perhaps come eventually. We focus mainly on the normal archive releases on releases.hashicorp.com and the docker images are there as a convenience but we don't have the resources on our team to maintain an increasingly-large surface area of official distribution channels at this time.

In the meantime, you could potentially take the Dockerfile we use to produce the existing "light" images and adapt it to work with a different architecture:

  • change the base image from alpine:latest to a similar base image for the architecure you want
  • change the archive URL template to say e.g. linux_arm instead of linux_amd64
  • change the other later references to the filenames containing linux_amd64 to be e.g. linux_arm instead

With that said, there are currently no official Terraform release packages for linux_arm64, so the above strategy will work only for 32-bit ARM at the moment. 64-bit ARM support is likely to come eventually -- I would expect it to come before docker image support on any other architectures, because the base releases are a prerequisite for the docker images -- but again, we don't have any firm plans to add other architectures at this time.

It's also worth considering that running Terraform in Docker is not as relevant as running some other software, because it's a statically-linked executable with no dependencies other than the Linux kernel system call interface. Therefore if you have an executable built for the architecture in question (either one of our official builds or your own build from source code) then it should be relatively straightforward to run it directly on one of the ARM-based devices you mentioned, without introducing the complexity of Docker.

FWIW the motivation for my 馃憤 here is because I'm using drone on a raspberry pi and it would be great to have an official container to use.

Was this page helpful?
0 / 5 - 0 ratings