Popular stories:

Docker VM shortcomings and how Hodor can help

Bright side

Finally Docker hype reached FastCompany and here I am adding to it : ) I wish I started with Docker intro post first, but I bet there are tons of stuff like this already on the nets. Instead I’ll assume most readers will already be familiar with Docker in some way.

My Docker journey started couple months ago, when our CTO came to me and said something like:

“Hey Sergey, I’ve heard there is this tool called Docker. It does many neat things, why don’t we try it out?”

“Try it out for what? We already have chef and everything seems to be working fine.” ( that’s me )

“I don’t know, you’ll figure it out” he said.

Honestly, I could let it pass, but somewhere deep inside I was eager to get some hands-on experience with Docker. I’ve heard a lot of great stuff about it by then. Plus we all know progress never stops, right?

For the first experiment I decided to improve our development / build process. There were many complains about complex dev environment setup every new / existing developer had to go through, install particular version of node, gems and stuff. Besides that, our production environment is running on Linux boxes, where devs are mostly on Macs. That forces us to run npm rebuild on integration server ( and dev boxes too ) to recompile extensions for particular architecture. With Docker we would one environment for prod and dev, no more recompilations, which is great.

I spent about a week to learn Docker basics and created couple containers to run our site. At that point everything was going great, I felt like Docker was the way to go. That was until I decided to try my new shiny workflow on Mac. I didn’t expect anything bad, because “Docker works everywhere: Linux, Mac, Windows! You just need tiny VM to make it work on Mac and Windows”.. Sighhh..

Dark side

One of the first things I realized running Docker on Mac was problem with volumes sharing. As part of our normal dev workflow we got used to running nodemon locally. Any change to codebase triggers node restart. Nice and fast.

I was able to recreate similar environment with Docker on Linux, where we would run nodemon in the container and codebase would be shared using Docker volumes. On Mac, however, you need to run Docker through VM, meaning that volumes no longer work.

On Boot2docker page you can see two approaches recommended for Folders sharing – Samba and VirtualBox Guest Additions ( bundled with recent versions for Boot2Docker). I tested both approaches ( actually I tested nfs and fuse as well ) – all turned out to be very slow for our project with lots (around 17K) of small files. Samba is especially inconvenient because you need to manually click around to connect to the server. Pain.

Another issue with VM is Port redirection. If you hacked your hosts file to point your development domains to localhost ( 127.0.0.1 fastcompany.local ), that no longer works because by default you need to access your container’s ports through VM ip $(boot2docker ip 2>/dev/null). I bet you don’t want to update your hosts every time VM’s ip changes.

Remember, my main goal was to create same workflow for people who use Linux and Mac (and yes Windows – eventually :)). I tried Vagrant, which at first seemed like what I needed, but eventually it felt like I lost a lot of Docker flexibility using it. Here is the good topic with more detailed Docker and Vagrant discussions.

That was not the reason I ditched it – Vagrant was too abstract, file sharing was slow and it didn’t provide all the stuff I wanted ( like ssh-agent forwarding in the containers ). Also I didn’t like the idea of installing sshd on my containers – more info here. Maybe it’s just me?

There must be a better way..

Hodor

Hodor Hodor Hodor!

I didn’t find any existing tool that gave me what I needed, so I decided to write my own. I called it Hodor. Why Hodor? Two things: first – my colleague said it’s sounds like a bad word in Spanish ( and I was pretty stressed out creating the tool at the time ), second – it’s a character from the great book Game of Thrones, a big strong guy that executes orders without asking too many questions.

Currently it’s very raw (but usable) and supports Linux and Mac only.

For current folder sharing on Mac I use combination of Unison, which, unlike Rsync, supports reliable two way sync and Fswatch which is used to trigger Unison on file change. This blend works pretty fast and is very lightweight.

For port sharing on Mac I use VirtualBox hacks like VBoxManage controlvm.

On Linux everything works natively, no special tricks required, plus you still get the benefit of the same workflow.

I helped to build and maintain the infrastructure for Game of Thrones, the biggest and most popular show in the world.

Do you want to know the single most important thing that I learned over the years?

NONE OF IT REALLY MATTERED…

Yes, it was fun for a while.

Yes, like most of us engineers I was making good money.

But at the end of the day, I would still have to show up at work and sell my time.

Sometimes I would come in, sit in my cubicle and dream about things I could do instead of staring at the screen all day long…

I could go to the beach with my wife and my son.

I could fly to El Classico game in Barcelona with my brother and watch Messi scoring amazing goals.

I could organize a surfing trip to South Africa and other awesome places around the world. Places I’ve never seen.

I could work on my own projects that would make the impact in the world or at the very least, make me some money.

Hell, I could just sit home and do absolutely nothing!

And yet there I was still in my cubicle 12 years later with big hopes and dreams and pretty much nothing to show for…

Sounds familiar?

The tipping point for me was when I started buying games on Steam and GoG and playing them in my mind.

Nothing to install, no need to upgrade video cards, no need to feel bad in front of my wife, no time to waste…

You are right, I was spiraling down and needed a break, but more so I felt like I needed some radical changes in my life.

I’m sure you heard this saying before: “Insanity: doing the same thing over and over again and expecting different results”

It became clear that the road I was walking on would lead me to mediocre life.

The problem was that I didn’t want to be mediocre. I wanted my life to be awesome, full of fun, happiness and excitement!

I wanted to make a difference in the world, leave a legacy, make my kids proud, live without regrets, discover my true purpose.

So about a year ago, I set out on my new journey…

I left my old comfortable job, attended multiple high profile non-technical events (including Tony Robbins UPW), joined an expensive business program, hired a personal coach and mentor, met a bunch of people who were able to disconnect from the Matrix and never looked back.

And let me tell you – there is another world out there, something we technical guys don’t get to experience!

There is hope.

Now, here is my question for you:

Do you want to continue to be just a tool in someone else’s hands or you want to upgrade yourself and become a Rain Maker?

If you want to find out who you really are, take full control of your life, step outside your comfort zone in order to grow physically, mentally and financially and help others along the way, then the Red pill is for you. Just drop your email in the field below and we’ll be in touch.

Take a Blue pill and you will forget that we ever met. You will close this popup and continue reading articles about Nginx, Kubernetes, Docker, secretly dreaming of life that you could have… (or pathetically thinking that you will have it one day just by perfecting technical skills)