Since the above command only outputs the actual containers ID's we can use it as so called command substitution to the original docker rm CONTAINER_ID. The following linux command will removed all currently not running docker containers on your docker host system:
# docker rm `docker ps -qa`
Error response from daemon: Conflict, You cannot remove a running container. Stop the container before attempting removal or use -f
FATA Error: failed to remove one or more containers
The above error message means that one or more of your containers are still running where all others have been successfully removed. If you are sure that you want to remove also any currently running docker containers add --force flag to your docker remove command. The following linux command will delete all containers regardless of their current status.