dpsrm < pattern docker cantainer name >

  
#!/bin/sh  
IFS=$'\n'  
echo $1  
  
docker ps -a --no-trunc  | grep $1 | awk '{print $1}' | xargs -r --no-run-if-empty docker stop  
docker ps -a --no-trunc  | grep $1 | awk '{print $1}' | xargs -r --no-run-if-empty docker rm  
docker rmi -f $(docker images | grep $1 | awk '{print $3}')