Search code examples
dockerkubernetes

How to list docker containers that are not running in kubernetes


For dev/testing, I am running a few docker containers outside the (single node) k8s cluster in the same machine. Is it possible to list down/watch running containers from docker directly but not from k8s pods?

Edit 1: Using docker runtime in the Kubernetes.


Solution

  • I am using watch 'docker container ls | grep -v k8s_'.

    grep -v selects the non-matched lines.