docker ps -f "name=postgres*" -q
--You don't have to check the ID one by one
docker exec -it $(docker ps -f "name=postgres*" -q) psql -c 'DROP DATABASE testdb'
Recommended Posts