Find container with its name

Page content

Get docker container id from container name

docker ps -aqf "name=containername"
docker ps -aqf "name=^containername$"
  • -q for quiet. output only the ID
  • -a for all. works even if your container is not running
  • -f for filter.
  • ^ container name must start with this string
  • $ container name must end with this string