Why Install When I Can Dockerize?

I haven't posted in forever. This post is mostly so I can break that streak. As such, there may be a lack of super interesting things in it.

Software Rant

I'll avoid the tired "containers are just encapsulation, man" rant. I might normally make the whole "nothing new under the sun" point if it weren't for the fact that the I'm currently mired in how wrong I think the "microservices are just SOA" crowd is. Just be glad that people are interested in the new thing and hope that they make it shinier.

I dislike having to install things on my laptop. Not everything, of course, but I don't want to install something for every little thing I want to play around with. Everything starts with install Ruby, Python, Go, D, Node.js then let them install who knows what (because everybody has to reinvent the package manager), who knows where, and create whatever inter-version incompatibilities they feel like. Then I wind up on StackOverflow trying to figure out the installation and debugging tricks those communities take for granted.

Sadly I still wind up with most of this shit on my box thanks to a handful of awesome tools like Ansible and Vagrant. I know it's ironic but I still have to draw the line somewhere.

WiFi Rant

So, I'm working at Google now (if you say congratulations I will punch you in the taint) and taking the bus to work. The bus has very shitty WiFi so to pass the time I either read e-books or watch downloaded content. XFinity has the best DVR option for this since their Android app will let you download anything you've recorded for offline viewing–fucking bad ass. Netflix and TiVo (and YouTube I believe) think that super awesome, streamy, creamy WiFi is everywhere. It's not and companies that don't support offline viewing hate America, freedom, and teenage Jesus. You really don't hear enough about teen Jesus…

Then I thought it'd be great to download some of the blog post backlog I have in Feedly (my RSS reader currently because fucking Google shut down Reader). That'd let me catch up on some of the stuff that falls under the "sharpening the tools" category of time wasting. Unfortunately 95% of the stuff in there comes from InfoQ which, to their credit, have video AND slides synced in their presentations. This means simply downloading video alone isn't good enough. What's a boy to do?

"Someone Beat Me to it" Rant

Someone else already wrote something to download InfoQ presentations for offline viewing. Since it's written in Python I took it for a test drive in a VM to avoid unnecessary dependency baggage from invading my system. The sumbitch works like a charm. It pulls everything into a folder and creates an HTML page you can use for offline viewing.

Fine. So I don't get to do that as a fun mini-project. I could still do something cool with Docker. For this post I don't care if Docker (or Rocket) will save the world. I care that I can encapsulate a bunch of shit into a container that is lighter weight than a virtual machine and treat it like a command. The inspiration came in the form of someone else's post that takes it even further with X11 applications. Baby steps.

Well some motherfucker beat me to that, too. Luckily though he used a bad naming convention and I couldn't get his container to work. So I built my own any way.

What Did I Accomplish?

I now have a bash script that wraps the slightly onerous Docker command to launch my container and download an InfoQ presentation for offline viewing. Yay! I also got to increase my public GitHub footprint (never a bad thing).

I learned that Docker handles host to container file permissions badly, Docker security has a long way to go, Docker Hub has some pretty nice continuous integration options for GitHub projects that have Dockefiles, and finally that I think it's better to waste 458mb of disk space to avoid putting more Python stuff on my laptop. Not a bad Saturday afternoon.


Leave a Reply