3 ms·
While asdf solves lots of pains, I still feel it solves the wrong problem. What I've instead started to do is to build docker images for various needs. Like, mu
by matsemann 4y ago
While asdf solves lots of pains, I still feel it solves the wrong problem. What I've instead started to do is to build docker images for various needs. Like, multiple of our projects need terraform, but all different versions. A project should then include that in its dev-dockerfile. No setup, just git clone a project and ready to go. No messing around with "to install and run X you need to have Y already installed, which half of you don't so for some reason it wont work in your environment".
- kubanczyk 4y ago> No setup, just git clone a project and ready to go. 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.
- e12e 4y agoWorks well without docker installed, does it? ;)
- JamesSwift 4y agoAgreed, I tend to treat my raw system as read-only and I much prefer it this way. Not only do I get the reproducibility, I also get the ability to more easily prune unused software.
- nicoburns 4y agoThat’s all well and good if you’re on Linux, but docker is super slow on Mac and windows. I’ve often worked places that develop iOS apps, s were stuck on macs, and thus alternatives to docker are very welcome. 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.
- matsemann 4y agoI feel docker is super fast on windows, as long as the files you mount are on wsl side. For instance most of my npm stuff is even faster there than lots of small files on Windows side.
- cdubzzz 4y agoVirtioFS[0] is making a _huge_ difference on the macOS side. I hated using Docker on macOS for a long time and started testing it as soon as it came out. Had some bad bugs initially and apparently does still have kinks being worked out but I’ve been using it consistently for a few months now and actually forgot all about how terrible the experience used to be. It is such a great improvement. [0] https://www.docker.com/blog/speed-boost-achievement-unlocked-on-docker-desktop-4-6-for-mac/ https://www.docker.com/blog/speed-boost-achievement-unlocked...
- maple3142 4y agoI get using docker is more painless, but I still prefer running things outside of a container when the setup isn't too complex. It is mostly because I have some heavily customized dev environment including zsh and all other tools installed, so developing in docker always make me miss a lot of things.
- JamesSwift 4y agoIn that case, if you can get it running in nix then thats an even better option.
- AlchemistCamp 4y agoAsdf is a great boon when upgrading language versions in a git branch and needing to switch back and forth between that branch and another feature branch without the upgraded language version. 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.
- computerlab 4y agotfswitch might help with particular issue of terraform versioning: https://tfswitch.warrensbox.com/ 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 https://github.com/kreuzwerker/m1-terraform-provider-helper Perhaps these sort of issues support the benefits of per-module docker images?