There in web are many examples to rm all containers with xargs,
but when to docker exec, you’ll have a command error like this,
~$ docker ps -lq | xargs docker exec bash
Error response from daemon: No such container: bash
I work around with this, but a error too.
$ docker ps -lq | xargs -I % docker exec -it % bash
the input device is not a TTY
I can do it with this,
$ docker exec -it {ID here} bash
What is wrong?