{"id":17838214,"url":"https://github.com/marcelcoding/docker-network-viewer","last_synced_at":"2025-04-02T13:47:48.940Z","repository":{"id":45178387,"uuid":"395084507","full_name":"MarcelCoding/docker-network-viewer","owner":"MarcelCoding","description":"Liste docker networks and according subnet.","archived":false,"fork":false,"pushed_at":"2022-02-05T16:32:21.000Z","size":83,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-08T04:46:44.288Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"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/MarcelCoding.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}},"created_at":"2021-08-11T18:36:13.000Z","updated_at":"2021-12-16T17:26:31.000Z","dependencies_parsed_at":"2022-09-24T19:50:43.003Z","dependency_job_id":null,"html_url":"https://github.com/MarcelCoding/docker-network-viewer","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelCoding%2Fdocker-network-viewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelCoding%2Fdocker-network-viewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelCoding%2Fdocker-network-viewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelCoding%2Fdocker-network-viewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarcelCoding","download_url":"https://codeload.github.com/MarcelCoding/docker-network-viewer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246827758,"owners_count":20840464,"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":[],"created_at":"2024-10-27T20:54:49.620Z","updated_at":"2025-04-02T13:47:48.902Z","avatar_url":"https://github.com/MarcelCoding.png","language":"Go","readme":"# Docker Network Viewer\n\nListe docker networks and according subnet.\n\n\n## Setup\n\n1. Setup my Debian Repository: [deb.m4rc3l.de](https://deb.m4rc3l.de/)\n2. `sudo apt install docker-network-viewer`\n3. Run `dnv` or `docker-network-viewer`\n\n## Credits\n\nThis replaces the old script `dnv.py`, witten by [@felbinger](https://github.com/felbinger).\n\u003cbr\u003e\nHe also had a Go version that was no longer maintained.\n\n```python\n#!/usr/bin/python3.8\n\nfrom docker import from_env as docker_env\nfrom prettytable import PrettyTable\nfrom os import geteuid\n\n\ndef get_networks():\n    networks = list()\n    for network in docker_env().networks.list():\n        if network:\n            config = network.attrs.get('IPAM').get('Config')\n            subnet = config[0].get('Subnet') if len(config) else None\n            if subnet:\n                networks.append([\n                    network.attrs.get('Name'),\n                    subnet\n                ])\n    return networks\n\n\nif __name__ == \"__main__\":\n    if geteuid() != 0:\n        print(\"Please run the script as root!\")\n        exit(1)\n\n    networks = sorted(get_networks(), key=lambda ip: list(map(int, ip[1].split(\"/\")[0].split(\".\"))))\n\n    table = PrettyTable()\n    table.field_names = [\"Name\", \"Subnet\"]\n    for row in networks:\n        table.add_row(row)\n\n    table.align['Name'] = 'l'\n    table.align['Subnet'] = 'l'\n    print(table)\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelcoding%2Fdocker-network-viewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcelcoding%2Fdocker-network-viewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelcoding%2Fdocker-network-viewer/lists"}