Docker – 3 Quick Tips

I’m reading and testing a bit about this new tool (Docker), and after some time I discovered some tips that I wanted to share with you guys.

1 – Check out other containers filesystems

Maybe for what you plan on installing inside a container, the default filesystem that Docker uses (AUFS), ins’t the best choice.
A pretty good example is a MySQL DB image, that has a problem already documented.
But don’t be alarmed, there is a workaround for this!
You just need to change your Docker filesystem to Device Mapper.

2 – Debugging Containers With Nsenter

If you want to debug your containers, and don’t feel very well installing a SSHD inside each container just to navigate inside it, then you should use Nsenter.
This allow you to get a prompt inside your container that has a process initialized, and it doesn’t hurt the Docker principle (one concern per container).

You can read more about this in here: If you run SSHD in your Docker containers, you’re doing it wrong!

3 – Test things with Vagrant!

Had problem installing Docker in your machine?
Or maybe you just want to test this new tool in a clean environment?
That’s easy, since the guys from Phusion created a base Vagrant image that has it’s a kernel ready to install docker.

So all you have to do is

$ vagrant init phusion/ubuntu-12.04-amd64

And you’ll have a Vagrantfile ready to go.

More info on this in here: Docker-friendly Vagrant base boxes

That’s all, and have fun playing with Docker!

About arruda

Adoro programar, descobrir novas frameworks ágeis e suas diversas aplicações.