docker ps
命令给出了在机器上运行的所有容器的列表。
由kubernetes,docker-compose或使用docker命令启动的容器。
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4522aaa65d4b gcr.io/kube-addon-manager:v6.4-beta.1 "/opt/kube-addons.sh" 39 hours ago Up 39 hours k8s_kube-addon-manager.....
88b141f545d3 gcr.io/pause-amd64:3.0 "/pause" 39 hours ago Up 39 hours k8s_POD.....
fe39bcdf10c0 celery "/usr/local/bin/celer" 39 hours ago Up 39 hours celery_worker
我希望看到所有不是由kubernetes启动的容器。
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
fe39bcdf10c0 celery "/usr/local/bin/celer" 39 hours ago Up 39 hours celery_worker
答案 0 :(得分:1)
它与docker ps | grep -v 'k8s_'