A few weeks ago I stumbled upon an interesting hackernews discussion
about setting up development environments: from what I could tell it seemed like
most people have been ditching Vagrant and VMs in order to move towards
docker containers, through docker-compose
or minikube.

Compose, to be fair, provides a painless user experience and allows you to extend
your Dockerfiles to be able to run containers with specific “dev” settings, like
local volumes and different commands (think node index.js vs nodemon index.js).

a file to extend that image with some dev settings (docker-compose.yml)

Since I wanted to play with rkt and I couldn’t find an easy way to maintain the
same workflow I had using docker, I decided to build a small tool called rkd
(rkt dev) that can help you achieve the same exact productivity you’d have
using docker and docker-compose. This is an early-stage experiment1 and, as such,
things might break here & there.

Let me recap it: like we’d do with docker, we’ll first need to download a bunch
of binaries, then create a file that describes our production container and, last
but not least, define our dev settings in another file.

If the whole thing takes longer than 5 minutes we fail, so let’s get to it!

Step 0: our sample NodeJS app

Create a brand new folder in your fs (path/to/my/app), a subfolder src and
place an index.js there:

Conclusion

I hope you enjoyed this article and are excited about the progress made by rkt
in order to provide a viable alternative to docker. I wrote rkd in a few hours
and it really is just a wrapper around acbuild & rkt, so kudos to those guys.

In my opinion, rkt is still quite behind docker but they’re filling the gaps,
getting closer as the days go by — it won’t be long until we’ll be realistically
able to switch over without “feeling” the difference.

Notes

I’ve been working on rkd during weekends, at conferences and over public WiFis, so you can imagine… :) ↩