{"id":13446418,"url":"https://github.com/docker/docker-py","last_synced_at":"2026-04-02T02:17:03.232Z","repository":{"id":8608331,"uuid":"10247874","full_name":"docker/docker-py","owner":"docker","description":"A Python library for the Docker Engine API","archived":false,"fork":false,"pushed_at":"2025-01-17T17:32:15.000Z","size":5150,"stargazers_count":6987,"open_issues_count":513,"forks_count":1679,"subscribers_count":192,"default_branch":"main","last_synced_at":"2025-05-05T15:52:32.796Z","etag":null,"topics":["docker","docker-engine-api","docker-swarm","python","python-library"],"latest_commit_sha":null,"homepage":"https://docker-py.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/docker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2013-05-23T16:15:07.000Z","updated_at":"2025-05-04T00:00:50.000Z","dependencies_parsed_at":"2023-01-14T11:48:24.282Z","dependency_job_id":"c04201df-e02c-40a7-a26a-4372a830f866","html_url":"https://github.com/docker/docker-py","commit_stats":{"total_commits":2322,"total_committers":463,"mean_commits":5.015118790496761,"dds":0.6180017226528854,"last_synced_commit":"bb0edd1f6655f06d8522879429584d90747dafe2"},"previous_names":["dotcloud/docker-py"],"tags_count":129,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker%2Fdocker-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker%2Fdocker-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker%2Fdocker-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docker%2Fdocker-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/docker","download_url":"https://codeload.github.com/docker/docker-py/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253795977,"owners_count":21965630,"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":["docker","docker-engine-api","docker-swarm","python","python-library"],"created_at":"2024-07-31T05:00:52.959Z","updated_at":"2025-12-11T21:48:49.570Z","avatar_url":"https://github.com/docker.png","language":"Python","funding_links":[],"categories":["Python","Operation System","Interaction","DevOps","python","语言资源库","Infrastructure \u0026 DevOps"],"sub_categories":["Server Infrastructure and High Performance Computing","High Performance Computing","Data Management","python"],"readme":"# Docker SDK for Python\n\n[![Build Status](https://github.com/docker/docker-py/actions/workflows/ci.yml/badge.svg)](https://github.com/docker/docker-py/actions/workflows/ci.yml)\n\nA Python library for the Docker Engine API. It lets you do anything the `docker` command does, but from within Python apps – run containers, manage containers, manage Swarms, etc.\n\n## Installation\n\nThe latest stable version [is available on PyPI](https://pypi.python.org/pypi/docker/). Install with pip:\n\n    pip install docker\n\n\u003e Older versions (\u003c 6.0) required installing `docker[tls]` for SSL/TLS support.\n\u003e This is no longer necessary and is a no-op, but is supported for backwards compatibility.\n\n## Usage\n\nConnect to Docker using the default socket or the configuration in your environment:\n\n```python\nimport docker\nclient = docker.from_env()\n```\n\nYou can run containers:\n\n```python\n\u003e\u003e\u003e client.containers.run(\"ubuntu:latest\", \"echo hello world\")\n'hello world\\n'\n```\n\nYou can run containers in the background:\n\n```python\n\u003e\u003e\u003e client.containers.run(\"bfirsh/reticulate-splines\", detach=True)\n\u003cContainer '45e6d2de7c54'\u003e\n```\n\nYou can manage containers:\n\n```python\n\u003e\u003e\u003e client.containers.list()\n[\u003cContainer '45e6d2de7c54'\u003e, \u003cContainer 'db18e4f20eaa'\u003e, ...]\n\n\u003e\u003e\u003e container = client.containers.get('45e6d2de7c54')\n\n\u003e\u003e\u003e container.attrs['Config']['Image']\n\"bfirsh/reticulate-splines\"\n\n\u003e\u003e\u003e container.logs()\n\"Reticulating spline 1...\\n\"\n\n\u003e\u003e\u003e container.stop()\n```\n\nYou can stream logs:\n\n```python\n\u003e\u003e\u003e for line in container.logs(stream=True):\n...   print(line.strip())\nReticulating spline 2...\nReticulating spline 3...\n...\n```\n\nYou can manage images:\n\n```python\n\u003e\u003e\u003e client.images.pull('nginx')\n\u003cImage 'nginx'\u003e\n\n\u003e\u003e\u003e client.images.list()\n[\u003cImage 'ubuntu'\u003e, \u003cImage 'nginx'\u003e, ...]\n```\n\n[Read the full documentation](https://docker-py.readthedocs.io) to see everything you can do.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocker%2Fdocker-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdocker%2Fdocker-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocker%2Fdocker-py/lists"}