This actually doesn't work properly because it relies on the exact column widths of `docker ps`.  What if we use inspect to grab the names instead?  It'll definitely be more reliable and supported:
```console
$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
b66fdb0ec872        docker:latest       hack/dind bash      10 minutes ago      Exit 0                                  jolly_pare          
d36d620416e5        f603ee3abc2e        rtorrent            10 hours ago        Up 10 hours                             rtorrent            
$ docker inspect -format '{{.Name}}' $(docker ps -a -q) | sed 's,^/,,'
jolly_pare
rtorrent
```
In this case, we even already have the container IDs, so it'd be as easy as `names="$( docker inspect -format '{{.Name}}' $containers | sed 's,^/,,' )"`.