I finally got my hands on Dev Containers in #VSCode and it's pretty solid! I decided to put some effort into learning Ruby so I thought it would be nice to explore it and try to use it for my use case so I avoid polluting my whole setup. Here are my learnings. ๐๐งต
First of all, what is it all about? Dev containers basically let you use a Docker container as a full-featured development environment. Great thing is that it works flawlessly with extensions, they can run in the context of the container with access to files and platform.๐
Why it's so awesome? Imagine your project is preconfigured for it. Anyone who just pulls the repo gets all the experience out of the box. Everything works, the configuration of Dev Container can also carry predefined settings and extensions. They can immediately dive into it! ๐คฟ
It's super easy to start with it, all you need to do is to open the command pallet and spin off some preconfigured ones by Microsoft. There's Node, Python, C++, Java, Rust but more of them (Ruby included) can be found here github.com/microsoft/vscode-dev-containers/tree/main/containers.
In my case, I tried to set up a simple Ruby project but ideally with decent DX so I can learn fast and it's somehow fun. ๐ฅณ I read a bit about it and then put together a boilerplate for my experiments. It has a language server, unit tests, linting, and debugger ready. ๐
I discovered exercism.org/tracks/ruby. Completely free, very easy-to-use platform full of coding exercises to help you pick up a new language fast. I signed for Ruby track and I made myself a promise to complete it in my spare time. Wish me luck! ๐ค๐ค
In case you would like to take a look at how it works, try it or you even want to join me in my Ruby journey feel free to take a look. It's on my Github github.com/jukben/ruby-101. In case you have Docker and VSCode installed you should be ready to go. I really like the concept.