Asdf can automatically install tool chain versions based on a plain text file stored in your repository, so it’s pretty plug and play too.
[0] https://www.docker.com/blog/speed-boost-achievement-unlocked...
Switching back and forth between branches with .tool-versions seamlessly switches to the correct version of the language and it “just works”. Trying to accomplish the same purely via docker is slow and painful.
Okay, a worthy target.
> No messing around
I will list layers that I guess you are using:
docker client binary
a command to run the thing <---
user-specific docker configuration
docker daemon as root
system-specific dockerd configuration
Dockerfile
embedded in it, a small shell script to download Terraform binary <---
files scattered on /var/lib/docker/* which never require cleanup
dns implementation
virtual bridge and other kernel-ish entities
tcp proxy
a running Terraform binary <---
I marked the layers that, in my opinion, would be enough to achieve the same goal. The explanation is that terraform is a self-contained binary that is not trying to scan system-wide or homedir-wide for files that can and will break it into dozen pieces. It is confined to the repo.
https://tfswitch.warrensbox.com/
Even then some versions of terraform providers are not compatible with M1 macs. Docker would help with that probably, but so can: https://github.com/kreuzwerker/m1-terraform-provider-helper
Perhaps these sort of issues support the benefits of per-module docker images?