Debugging Docker network connectivity

A few weeks ago I wrote a short article, networking basics with docker. Since then, I’ve migrated my production environment to be docker only, and I’ve deployed 5 docker hosts which handle various tasks, from a production file server, search server with solr, my complete development environment and some websites (including this one!).

Over the course of a week I was hitting a few timeouts in connecting from one docker container to another, and finally, yesterday I consistently pinpointed a 4+ second delay on an API service I was writing. Four seconds. I’ll go over the steps that I took to diagnose and resolve the issue.

Read more

How to live inside a docker container?

This is a story of how I learned to stop worrying and love the bomb. Well, it’s just about as iconic. Lone developer turns to Docker to set up a clean development environment as seamlessly as possible, including the bells and whistles of SSH agent forwarding. I’m pretty sure some of the folks on Docker HQ might have a small panic attack reading this one. Alas, I’m not a cardiac health professional.
Read more

Run NodeJS anywhere using Docker and Nexe

A project I’m working on currently requires me to build a server side agent daemon. Due to the nature of the agent, a live connection requires to be open to the managing node server, using websockets. PHP is not very well suited to this kind of workload, so the obvious choice was to develop it using NodeJS. I will build a Docker image containing the application, as well as provide a standalone binary for people who don’t have Docker, but also don’t want the hassle of installing NodeJS.

Read more

Premature optimization

In my many years as a software developer, this is one phrase which I have heard over and over: "Don't optimize your software prematurely." I have no idea where the phrase came from. I know that most software is shit because people don't know any better. And generalities like this encourage people to write bad software. I will try to list a few things that I think make up a good developer culture.
Read more

PHP Comparisons

If there is something every developer (not just PHP) should know, it's when to use a strict equality operator. Interestingly enough, using empty() in PHP has exact behavior as checking loose equality with `== false`. This whole thing was inspired (and partially ripped off of) the JavaScript Equality Table. The design caught my eye, more than anything. I'm kinda wishing most if not all languages would have this kind of basic reference.
Read more