"bad listen address format" docker error on Debian (and elsewhere)

Posted on 18.02.2017

I just encountered an issue on my Debian sid (“unstable”) system where docker wouldn’t start due to incompatibilities between its components.

On my search on the net, I found various proposals to just downgrade containerd, but I thought that’s kinda lame (and it’s also tedious to make sure that all the dependencies are still met and upgrades still work for everything else).

The sign that something went wrong was this message in the log:

msg="bad listen address format /var/run/docker/libcontainerd/docker-containerd.sock, expected proto://address"

And the solution was putting a wrapper for containerd in /usr/local/bin to translate the old into the new address format:

#!/bin/sh
cmd="/usr/bin/containerd"
while [ $# -gt 0 ]; do
      cmd="$cmd $1"
      if [ $1 = "-l" ]; then
            shift
            cmd="$cmd unix://$1"
      fi
      shift
done
exec $cmd