{"id":13695285,"url":"https://github.com/theodorosploumis/dophpsdk","last_synced_at":"2025-08-14T23:30:49.151Z","repository":{"id":57072241,"uuid":"113864817","full_name":"theodorosploumis/dophpsdk","owner":"theodorosploumis","description":"A simple Docker PHP sdk","archived":false,"fork":false,"pushed_at":"2017-12-12T23:46:10.000Z","size":24,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-22T15:11:42.890Z","etag":null,"topics":["composer-package","docker","docker-sdk","docker-wrapper","packagist","php","sdk"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/tplcom/dophpsdk","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theodorosploumis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-11T13:52:33.000Z","updated_at":"2024-03-13T12:37:35.000Z","dependencies_parsed_at":"2022-08-24T14:54:34.542Z","dependency_job_id":null,"html_url":"https://github.com/theodorosploumis/dophpsdk","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/theodorosploumis/dophpsdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theodorosploumis%2Fdophpsdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theodorosploumis%2Fdophpsdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theodorosploumis%2Fdophpsdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theodorosploumis%2Fdophpsdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theodorosploumis","download_url":"https://codeload.github.com/theodorosploumis/dophpsdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theodorosploumis%2Fdophpsdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270499890,"owners_count":24595146,"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","status":"online","status_checked_at":"2025-08-14T02:00:10.309Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["composer-package","docker","docker-sdk","docker-wrapper","packagist","php","sdk"],"created_at":"2024-08-02T18:00:20.652Z","updated_at":"2025-08-14T23:30:48.834Z","avatar_url":"https://github.com/theodorosploumis.png","language":"PHP","funding_links":[],"categories":["Docker PHP sdk (clients)"],"sub_categories":[],"readme":"# Simple Docker php sdk\n\n**DOcker PHP SDK -\u003e dophpsdk**\n\nThis is a small and simple php package that allows docker manipulations through php.\n\nSimilar projects can be found at https://github.com/theodorosploumis/awesome-docker-php.\n\n### Requirements\n- php\n- composer\n\nPhp needs to be able to run docker commands. For example, if using Apache server run this:\n\n```\nusermod -aG docker www-data\n```\n\n### Installation\n\n```\ncomposer require tplcom/dophpsdk\n```\n\n### Usage\n\nFor all the available functions see the classes [Container.php](https://github.com/theodorosploumis/dophpsdk/blob/master/src/Container.php) and [Docker.php](https://github.com/theodorosploumis/dophpsdk/blob/master/src/Docker.php).\n\n```\n\u003c?php\n\nrequire_once __DIR__ . \"/src/Docker.php\";\nrequire_once __DIR__ . \"/src/Container.php\";\n\ninclude 'vendor/autoload.php';\n\nuse dophpsdk\\Docker;\nuse dophpsdk\\Container;\n\n$name = \"drupal\";\n$image = \"drupal:8.4.3\";\n$container_name = \"drupal_4\";\n\n// Create some new Container objects for image https://hub.docker.com/_/drupal\n for ($i = 1; $i \u003c= 5; $i++) {\n   $settings = [\n     \"Name\" =\u003e $name . \"_\" . $i,\n     \"Config\" =\u003e [\n       \"Image\" =\u003e $image\n     ]\n   ];\n   \n   $container = new Container($settings);\n\n   // Get the Container object\n   var_dump($container);\n }\n \n// Create a new Docker object\n$docker = new Docker();\n\n$info = $docker-\u003einfo();\nvar_dump($info);\n\n$version = $docker-\u003eversion();\nvar_dump($version);\n\n$images = $docker-\u003eimages();\nvar_dump($images);\n\n$ps = $docker-\u003eps();\nvar_dump($ps);\n\n$stats = $docker-\u003eContainerStats();\nvar_dump($stats);\n\n$logs = $docker-\u003eContainerLogs($container_name);\nvar_dump($logs);\n\n$docker-\u003eContainerStop($container_name);\n$docker-\u003eContainerStart($container_name);\n$docker-\u003eContainerRestart($container_name);\n\n$isRunning = $docker-\u003eContainerIsRunning($container_name);\n\nif($isRunning == TRUE) {\n  print \"Yes, container \" . $container_name . \" is running\\n\";\n} else if (!is_null($isRunning) \u0026\u0026 $isRunning == FALSE) {\n  print \"No, container \" . $container_name . \" is not running\\n\";\n} else {\n  print \"There is no such container \" . $name . \"\\n\";\n}\n\n$create = $docker-\u003eContainerCreate($image);\nvar_dump($create);\n\n$run = $docker-\u003eContainerRun($image);\nvar_dump($run);\n\n$rm = $docker-\u003eContainerRm(\"drupal_1\");\nvar_dump($rm);\n\n$kill = $docker-\u003eContainerKill(\"drupal_1\");\nvar_dump($kill);\n\n$delete = $docker-\u003eContainerDelete(\"drupal_2\");\nvar_dump($delete);\n\n$rename = $docker-\u003eContainerRename(\"drupal_4\", \"My name\");\nvar_dump($rename);\n\n$exec = $docker-\u003eContainerExec(\"drupal_4\", \"ls -l\");\nvar_dump($exec);\n\n$update = $docker-\u003eContainerUpdate(\"drupal_4\", \"--restart on-failure\");\nvar_dump($docker-\u003eContainerInspect(\"drupal_4\"));\n\n$docker-\u003eContainerPause(\"drupal_4\");\n$unpause = $docker-\u003eContainerUnpause(\"drupal_4\");\nvar_dump($unpause);\n\n$commit = $docker-\u003eContainerCommit(\"drupal_4\", \"test/test\");\nvar_dump($docker-\u003eimages(\"test/test\"));\n\n$rmi = $docker-\u003ermi(\"test/test\");\nvar_dump($rmi);\n\n$diff = $docker-\u003eContainerDiff(\"drupal_4\");\nvar_dump($diff);\n\n```\n\n### License\n\n**GNU v2**. \n\nSee [LICENSE](https://github.com/theodorosploumis/dophpsdk/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheodorosploumis%2Fdophpsdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheodorosploumis%2Fdophpsdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheodorosploumis%2Fdophpsdk/lists"}