{"id":18896848,"url":"https://github.com/shakibamoshiri/dq","last_synced_at":"2026-05-09T19:33:24.765Z","repository":{"id":128566862,"uuid":"439367304","full_name":"shakibamoshiri/dq","owner":"shakibamoshiri","description":"Debug docker quickly using Docker Query","archived":false,"fork":false,"pushed_at":"2022-04-24T19:22:25.000Z","size":70,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-31T08:16:25.875Z","etag":null,"topics":["debugging","devops-tools","docker","nodejs","sre"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shakibamoshiri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-17T14:53:54.000Z","updated_at":"2022-12-24T19:58:51.000Z","dependencies_parsed_at":"2023-05-04T22:46:58.216Z","dependency_job_id":null,"html_url":"https://github.com/shakibamoshiri/dq","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakibamoshiri%2Fdq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakibamoshiri%2Fdq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakibamoshiri%2Fdq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakibamoshiri%2Fdq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shakibamoshiri","download_url":"https://codeload.github.com/shakibamoshiri/dq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239877152,"owners_count":19712021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debugging","devops-tools","docker","nodejs","sre"],"created_at":"2024-11-08T08:35:33.696Z","updated_at":"2026-05-09T19:33:24.715Z","avatar_url":"https://github.com/shakibamoshiri.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dq\nDebug docker quickly using **D**ocker **Q**uery\n\nDebugging one container using `docker inspect` is okay if we are running just one.  \nBut debugging many of them with different networks, names, ports, etc can be cumbersome.  \n**dq** is a simple CLI to query API, extract some information and show it for all containers.\n\n## Designed for\nAnyone whats to debug small to medium size running containers.  \nAnyone learns and teaches docker and containers:\n - System Administrator, DevOps, Troubleshooter, etc\n - YouTubers\n - Bloggers\n - Course makers\n - etc\n\n\n## Examples\nFor two containers, one is running, one is not.\n\n```bash\ndocker ps --all\nCONTAINER ID   IMAGE                    COMMAND                  CREATED       STATUS                   PORTS                                   NAMES\n1096b57f9049   nginx:alpine             \"/docker-entrypoint.…\"   2 hours ago   Up 2 hours               0.0.0.0:8080-\u003e80/tcp, :::8080-\u003e80/tcp   nginx-1\n0e764fa35fe2   docker/getting-started   \"/docker-entrypoint.…\"   2 weeks ago   Exited (0) 2 weeks ago                                           stoic_haibt\n```\n\nQuery for:\n - name\n - ip\n - net\n - subnet\n - gateway\n - pid\n - status\n - ports\n\n\n```bash\n./dq -q name ip net subnet gw pid status ports\nname        ip         net    subnet        gw         pid  status  ports\nnginx-1     172.17.0.2 bridge 172.17.0.0/16 172.17.0.1 2423 running 80/tcp\nstoic_haibt            bridge 172.17.0.0/16 172.17.0.1 0    exited\n```\nThat was normal output, but we can have an table output:\n```bash\n./dq -t -q name ip net subnet gw pid status ports\n┌─────────┬───────────────┬──────────────────┬──────────────┬─────────────────────┬──────────────────┬──────┬───────────┬──────────────┐\n│ (index) │     name      │        ip        │     net      │       subnet        │        gw        │ pid  │  status   │    ports     │\n├─────────┼───────────────┼──────────────────┼──────────────┼─────────────────────┼──────────────────┼──────┼───────────┼──────────────┤\n│    0    │   'nginx-1'   │ [ '172.17.0.2' ] │ [ 'bridge' ] │ [ '172.17.0.0/16' ] │ [ '172.17.0.1' ] │ 2423 │ 'running' │ [ '80/tcp' ] │\n│    1    │ 'stoic_haibt' │      [ '' ]      │ [ 'bridge' ] │ [ '172.17.0.0/16' ] │ [ '172.17.0.1' ] │  0   │ 'exited'  │      []      │\n└─────────┴───────────────┴──────────────────┴──────────────┴─────────────────────┴──────────────────┴──────┴───────────┴──────────────┘\n```\n\nA screenshot of two above queries:\n![screenshot.1.png](./screenshot.1.png)\n\n\n\nThe same query where there are more:\n```bash\n./dq -q name ip net subnet gw pid status ports\nname                           ip                     net                   subnet                       gw                     pid     status  ports\nocserv-docker_ocserv_1         172.19.0.2             ocserv-docker_default 172.19.0.0/24                172.19.0.1             2787426 running 443/tcp,443/udp\nradius                         172.19.62.3            radius-ui_default     172.19.62.0/24               172.19.62.1            3968972 running 1812/tcp,1812/udp,1813/tcp,1813/udp,80/tcp\nradius-mysql                   172.19.62.2            radius-ui_default     172.19.62.0/24               172.19.62.1            3868824 running 3306/tcp\ningress_nginx-proxy_1          172.18.0.5             br0                   172.18.0.1/16                172.18.0.1             3846630 running 443/tcp,80/tcp\ningress_nginx-default_1        172.18.0.4             br0                   172.18.0.1/16                172.18.0.1             3840347 running 80/tcp\nminio_minio-nginx_1            172.18.0.6,172.19.52.3 br0,minio_default     172.18.0.1/16,172.19.52.0/24 172.18.0.1,172.19.52.1 3371918 running 80/tcp\nminio_minio-server_1           172.19.52.2            minio_default         172.19.52.0/24               172.19.52.1            3371794 running 9000/tcp\ndrone-runner_drone-agent_1     172.19.7.2             drone-runner_default  172.19.7.0/24                172.19.7.1             2942737 running 3000/tcp\ningress_whoami_1               172.18.0.3             br0                   172.18.0.1/16                172.18.0.1             3732128 running 8000/tcp\ningress_nginx-acme-companion_1 172.18.0.2             br0                   172.18.0.1/16                172.18.0.1             3732325 running\n```\n\nAnother Query for:\n - name\n - hostip (host ip)\n - ip (container ip)\n - hostport (host port)\n - port (container port)\n - gw (gateway)\n - subnet\n - net\n - scope\n\n```bash\n./dq -q name hostip ip hostport port gw subnet net scope\nname        hostip                ip         hostport            port           gw         subnet        net    scope\nnginx-3     0.0.0.0,::,0.0.0.0,:: 172.17.0.4 8088,8088,8082,8082 443/tcp,80/tcp 172.17.0.1 172.17.0.0/16 bridge local\nnginx-2     0.0.0.0,::            172.17.0.3 8081,8081           80/tcp         172.17.0.1 172.17.0.0/16 bridge local\nnginx-1     0.0.0.0,::            172.17.0.2 8080,8080           80/tcp         172.17.0.1 172.17.0.0/16 bridge local\nstoic_haibt                                                                     172.17.0.1 172.17.0.0/16 bridge local\n```\n\n## Prerequisite\nApp has been written in **Node.js**, so having Node.js and npm is needed.\n\n## How to install\nFirst clone the repository:\n```bash\ngit clone https://github.com/shakibamoshiri/dq.git\n```\n\nThen `cd` to **dq** directory\n```bash\ncd dq\n```\n\nThen run `npm` to install dependencies\n```bash\nnpm install\n```\n\nThen test it\n```bash\n./dq -h\n```\n\nYou should see help output. At this port you can use it in a local directory or installing globally\n```bash\nsudo chmod +x dq\nsudo install dq -t /usr/local/bin/\n```\n\n## API compatibility\nYou can run [check-docker-api.sh](./check-docker-api.sh) to check your Docker API.  \n`dq` has been tested and compatible with [Docker Engine API (v1.41)](https://docs.docker.com/engine/api/v1.41/) \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshakibamoshiri%2Fdq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshakibamoshiri%2Fdq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshakibamoshiri%2Fdq/lists"}