#!/bin/bash
read -p "输入想要查找容器名字的pid号:" pid
docker ps | grep $(cat /proc/${pid}/mountinfo | grep /var/lib/docker/containers | head -1 | awk -F / '{print $6}'|cut -c 1-8 )
#!/bin/bash
read -p "输入想要查找容器名字的pid号:" pid
docker ps | grep $(cat /proc/${pid}/mountinfo | grep /var/lib/docker/containers | head -1 | awk -F / '{print $6}'|cut -c 1-8 )