why i stopped using docker for local dev

system

docker is great until it isn't

i used docker for local development for four years. docker-compose files, volume mounts, multi-stage builds. the whole ecosystem.

then i switched to nix. i haven't looked back.

the problems i had with docker

cold start time: spinning up a compose stack took 15-30 seconds. with nix devShells, my environment is ready in under a second — the packages are already on disk.

volume mount performance: on macOS, bind mounts are slow. the file system virtualization between the Linux VM and the macOS host adds latency to every file read. hot reload in a containerized dev server was noticeably laggy.

opacity: what's actually inside that image? which version of openssl? you can inspect it, but it requires effort. with nix, every dependency is explicit in the flake.

what i use instead

devShells.default = pkgs.mkShell {
  packages = [
    pkgs.nodejs_20
    pkgs.postgresql_15
    pkgs.redis
  ];
  shellHook = '
    export DATABASE_URL="postgresql://localhost/myapp"
    pg_ctl start -D .postgres
  ';
};

postgres and redis run as processes, not containers. they start instantly. file access is native speed.

when i still use docker

for production deployments and CI. nix for development, docker for shipping. the best of both worlds.

Command Palette

Search for a command to run...