How to kill all Docker containers based on a given image?
This will do want I want: killing all containers directly based on mariadb regardless of their tag--and without killing containers having mariadb somewhere higher in their ancestor list.

sudo docker kill $(
  sudo docker ps --format '{{.ID}} {{.Image}}' | awk '$2 ~ /^mariadb:/ { print $1}'
)