docker ps
looks like. Although there are various workarounds on this topic (see the end of the material) , one day some enthusiast had to do “something else” ... and this happened in the ensuing 2019. His name is docker-pretty-ps .docker-pretty-ps my,try
will display containers with *my*
and *try*
found in their names (for example, docker-registry
and mysql-redmine
);container_id
, created
, ports
, image_id
, status
, command
);slim
(removes all the fields listed above, leaving only the names of the containers): pip install docker-pretty-ps
git clone https://github.com/politeauthority/docker-pretty-ps.git cd docker-pretty-ps python3 setup.py build python3 setup.py install
$ docker-pretty-ps -h usage: docker-pretty-ps [-h] [-a] [-s] [-i INCLUDE] [-o [ORDER]] [-r] [-j] [-v] [search] positional arguments: search Phrase to search containers, comma separate multiples. optional arguments: …
slim
mode will not always be convenient. And then one of the well-known workarounds can be more useful.docker ps
is not just a workaround, but in a sense, the best solution, since does not require anything extra in terms of installation in the system.--format
argument is accepted by many Docker commands, allowing (via the go-template ) to customize their output for themselves. For the docker ps
its support has appeared a long time ago (in the release of Docker 1.8 from August 2015). Here is an example of its use: [flant] d.shurupov@kube-node-test ~ $ sudo docker ps --format 'table {{.Names}}\t{{.Image}}' NAMES IMAGE k8s_fluentd_fluentd-jmzjd_loghouse… flant/loghouse-fluentd… k8s_cert-manager_cert-manager-… quay.io/jetstack/cert-manager-controller… k8s_prometheus-config-reloader_… 597141b113d9 k8s_prometheus_prometheus-main-… cc866859f8df k8s_POD_prometheus-main-0_kube-… k8s.gcr.io/pause-amd64:3.1 …
--format
can be found, for example, in this article , and examples of available functions can be found in the Docker documentation .top
, but for Docker containers:alias ctop='docker run --rm -ti -v /var/run/docker.sock:/var/run/docker.sock quay.io/vektorlab/ctop:latest'
Source: https://habr.com/ru/post/436896/