Skip to content

Instantly share code, notes, and snippets.

@chris-martin
Last active July 5, 2016 23:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chris-martin/4732bfcccab42e657ff5b63fd948809a to your computer and use it in GitHub Desktop.
Save chris-martin/4732bfcccab42e657ff5b63fd948809a to your computer and use it in GitHub Desktop.

Best thing about Docker

To run something messy with complicated dependencies that was designed for a big distro like Ubuntu and doesn't have a Nix package built for it yet, Docker provides a sledgehammer approach that is simple and reliable.

For things like CI servers, it seems like a good lightweight alternative to VMs.

Worst thing about Docker

Non-repeatability of image builds that do network I/O, and no cache for those builds (e.g. for dockerfiles using apt-get).

Top of Docker wish list

The tooling around it could use more work. I felt some mismatch between what Compose what trying to do and what I wanted it be for.

Rant

I started using Docker out of a desire for a single-command no-fuss way for developers to get our app running. To that aim, it worked, but it introduced as many problems as it solved. One team member couldn't get volume mounting to work in his ecryptfs home directory, and didn't have enough disk space allocated to his root filesystem for all of the images. Using an SSH agent within containers was a mess. I had a hard time keeping disk space free and tried several third-party garbage collectors. I spent a lot of time waiting for images to build and containers to restart.

I then started using the Nix package manager, and I've realized that it solves all of the problems that I had wanted Docker to solve, without introducing its problems. I have true repeatable builds because all downloads have their hashes verified. All downloads and package builds are cached in /nix/store (which is immutable and hash-addressed). Garbage collection is built-in. I have isolation only in the way that really matters - packages and their dependencies, so it's trivial to have multiple versions of something running side-by-side. I can use nix-shell to be up and running in an environment with any set of dependencies nearly instantaneously. I don't use Docker anymore.

I think my takeaway lesson here is that, if you have a sufficiently powerful package manager, containers generally aren't the best tool for development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment