Skip to main content

idocker

Package version downloads
Supported Python versions GitHub

简体中文 | English

Introduce

This tool is a supplement to docker's official command line tool and can output container information in a human-friendly way to increase readability

⭐️ 🌟 ✨ ⚡️ ☄️ 💥

Installation

Package is uploaded on PyPI: idocker

You can install it with pip:

pip install idocker

Requirements

  • Python : 3.8 and newer
  • Make sure you have docker installed on your machine

Documentation

📄 Intensified preparation in progress

Example

View container running information

Enter the command in the terminal: idocker ps

The following output is obtained

There is a total of 17 container
| id           | status     | name                 | memory    |   cpu (%) |
|:-------------|:-----------|:---------------------|:----------|----------:|
| f96ba3157d97 | ⭕️ exited  | mystifying_kapitsa   | 0.0 MB    |     0     |
| 1647f82f4f5d | ⭕️ exited  | hardcore_benz        | 0.0 MB    |     0     |
| d34a102050d3 | ⭕️ exited  | minikube             | 0.0 MB    |     0     |
| 62e74fb7138e | ⭕️ exited  | nginx                | 0.0 MB    |     0     |
| 21b45572fd50 | ⭕️ exited  | thirsty_stonebraker  | 0.0 MB    |     0     |
| 3a7729ee272b | ⭕️ exited  | sad_lalande          | 0.0 MB    |     0     |
| 16e49729de2d | ⭕️ exited  | twitter_redis        | 0.0 MB    |     0     |
| 98df9168bbd5 | ⭕️ exited  | rustdesk-hbbr        | 0.0 MB    |     0     |
| bf19958f710f | ⭕️ exited  | rustdesk-hbbs        | 0.0 MB    |     0     |
| 874838b6335d | ⭕️ exited  | twitter_mysql8       | 0.0 MB    |     0     |
| 57469356f55b | ⭕️ exited  | heuristic_northcutt  | 0.0 MB    |     0     |
| 6fd8b4c901f1 | ⭕️ exited  | competent_ritchie    | 0.0 MB    |     0     |
| cb0ef103c8f6 | ✅ running | twitter_memcahed     | 5.57 MB   |     0.007 |
| aa291a307aac | ✅ running | rebloom              | 8.65 MB   |     0.098 |
| 1e08693fdcfd | ✅ running | public_minio         | 108.28 MB |     0.055 |
| 7b411cf33283 | ✅ running | rabbitmq3-management | 144.1 MB  |     0.556 |
| c50ca07d3d41 | ✅ running | mysql8               | 282.34 MB |     0.339 |

By default, the sorting is in ascending order of memory usage

If you want to change the default sorting, you can see the help information 'idocker ps --help'

Usage: python -m idocker.cli.main ps [OPTIONS]

  view all container

Options:
  --id              Sort by id
  --status          Sort by id
  --name            Sort by name
  --cpu             Sort by cpu stats usage
  --mem             Sort by memory stats usage  [default: True]
  -i, --image_name  Show Image name
  --help            Show this message and exit.

For example, if you want to know which containers are using the most cpu, you can type 'idocker ps --cpu' and it will be sorted in ascending order of cpu usage

There is a total of 17 container
| id           | status     | name                 | memory    |   cpu (%) |
|:-------------|:-----------|:---------------------|:----------|----------:|
| f96ba3157d97 | ⭕️ exited  | mystifying_kapitsa   | 0.0 MB    |     0     |
| d34a102050d3 | ⭕️ exited  | minikube             | 0.0 MB    |     0     |
| 62e74fb7138e | ⭕️ exited  | nginx                | 0.0 MB    |     0     |
| 57469356f55b | ⭕️ exited  | heuristic_northcutt  | 0.0 MB    |     0     |
| 16e49729de2d | ⭕️ exited  | twitter_redis        | 0.0 MB    |     0     |
| 21b45572fd50 | ⭕️ exited  | thirsty_stonebraker  | 0.0 MB    |     0     |
| 1647f82f4f5d | ⭕️ exited  | hardcore_benz        | 0.0 MB    |     0     |
| 3a7729ee272b | ⭕️ exited  | sad_lalande          | 0.0 MB    |     0     |
| bf19958f710f | ⭕️ exited  | rustdesk-hbbs        | 0.0 MB    |     0     |
| 6fd8b4c901f1 | ⭕️ exited  | competent_ritchie    | 0.0 MB    |     0     |
| 874838b6335d | ⭕️ exited  | twitter_mysql8       | 0.0 MB    |     0     |
| 98df9168bbd5 | ⭕️ exited  | rustdesk-hbbr        | 0.0 MB    |     0     |
| cb0ef103c8f6 | ✅ running | twitter_memcahed     | 5.57 MB   |     0.007 |
| 1e08693fdcfd | ✅ running | public_minio         | 107.95 MB |     0.054 |
| aa291a307aac | ✅ running | rebloom              | 8.63 MB   |     0.098 |
| c50ca07d3d41 | ✅ running | mysql8               | 281.5 MB  |     0.338 |
| 7b411cf33283 | ✅ running | rabbitmq3-management | 143.62 MB |     0.553 |

Note that cpu 100% does not mean that 100% of the whole machine is consumed, but 100% of the single core

Sometimes, we seem to know the image name of the container, we can add '-i' or '--image name' parameter to display the image name at the same time

╰─➤  idocker ps -i
There is a total of 21 container
| id           | status     | name                 | memory    |   cpu (%) | image                                    |
|:-------------|:-----------|:---------------------|:----------|----------:|:-----------------------------------------|
| 16e49729de2d | ⭕️ exited  | twitter_redis        | 0.0 MB    |     0     | redis:latest                             |
| 62e74fb7138e | ⭕️ exited  | nginx                | 0.0 MB    |     0     | nginx:latest                             |
| 3a7729ee272b | ⭕️ exited  | sad_lalande          | 0.0 MB    |     0     | 192.168.31.245:8081/python:3.10-buster   |
| 98df9168bbd5 | ⭕️ exited  | rustdesk-hbbr        | 0.0 MB    |     0     | rustdesk/rustdesk-server:1.1.6           |
| d34a102050d3 | ⭕️ exited  | minikube             | 0.0 MB    |     0     | kicbase/stable:v0.0.36                   |
| 1647f82f4f5d | ⭕️ exited  | hardcore_benz        | 0.0 MB    |     0     | ubuntu:latest                            |
| 6fd8b4c901f1 | ⭕️ exited  | competent_ritchie    | 0.0 MB    |     0     | ubuntu:latest                            |
| 874838b6335d | ⭕️ exited  | twitter_mysql8       | 0.0 MB    |     0     | mysql:8.0                                |
| f96ba3157d97 | ⭕️ exited  | mystifying_kapitsa   | 0.0 MB    |     0     | sha256:b7fb33a5a7bb                      |
| 57469356f55b | ⭕️ exited  | heuristic_northcutt  | 0.0 MB    |     0     | 192.168.31.245:8081/python:3.10-buster   |
| 21b45572fd50 | ⭕️ exited  | thirsty_stonebraker  | 0.0 MB    |     0     | sha256:b7fb33a5a7bb                      |
| bf19958f710f | ⭕️ exited  | rustdesk-hbbs        | 0.0 MB    |     0     | rustdesk/rustdesk-server:1.1.6           |
| cb0ef103c8f6 | ✅ running | twitter_memcahed     | 2.09 MB   |     0.008 | memcached:latest                         |
| aa291a307aac | ✅ running | rebloom              | 5.74 MB   |     0.104 | redislabs/rebloom:latest                 |
| 84ef73971e0d | ✅ running | zilliz_attu          | 75.91 MB  |     0.022 | zilliz/attu:v2.2.7                       |
| 75f08019e787 | ✅ running | milvus-etcd          | 77.74 MB  |     0.688 | quay.io/coreos/etcd:v3.5.5               |
| 98c1082f8e5b | ✅ running | milvus-minio         | 87.07 MB  |     0.098 | minio/minio:RELEASE.2022-03-17T06-34-49Z |
| 78e26a299331 | ✅ running | public_minio         | 133.05 MB |     0.11  | minio/minio:RELEASE.2023-09-04T19-57-37Z |
| 7b411cf33283 | ✅ running | rabbitmq3-management | 156.2 MB  |     0.477 | rabbitmq:3-management                    |
| e2618c7ec2ec | ✅ running | milvus-standalone    | 317.84 MB |     4.369 | milvusdb/milvus:v2.2.9                   |
| c50ca07d3d41 | ✅ running | mysql8               | 739.54 MB |     1.026 | mysql:8                                  |

View container port information

Enter the command in the terminal: idocker port

The following output is obtained

There is a total of 3 container
elk-kibana-7
    Host     -> Container
    5601     -> 5601
    5601     -> 5601

elk-elasticsearch-7
    Host     -> Container
    9200     -> 9200
    9200     -> 9200
    9300     -> 9300
    9300     -> 9300

rebloom
    Host     -> Container
    6379     -> 6379
    6379     -> 6379

Metadata

Release files for idocker 1.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for idocker 1.6.0
File Size Uploaded
idocker-1.6.0.tar.gz 11.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for idocker 1.6.0
File Interpreter ABI Platform
idocker-1.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.7 kB

Release files / idocker-1.6.0.tar.gz

Download URL idocker-1.6.0.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7425fdccd5da38cf78c81b65932dd53ccb0373aaa62652917ab78a82088f988f
BLAKE2b-256 checksum
How to use checksums
853d3505aed0bf7299ed0b36f972dd063feea970b111da6c982619c899c8c9ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.21

Release files / idocker-1.6.0-py3-none-any.whl

Download URL idocker-1.6.0-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ffc94c881cf58655ec2fd61b185320e5912f3d10209be47a1dde490efbeb940e
BLAKE2b-256 checksum
How to use checksums
82dd240907efbc00d33b5bdcc66f724b00a2b44ab0739e055dc51c0c9128390a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.21

Release history Release notifications | RSS feed

This release

1.6.0 This release

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page