1+ <?php
2+
3+ namespace Webteractive \Devstack ;
4+
5+ use Symfony \Component \Console \Application ;
6+ use Webteractive \Devstack \Commands \RunDockerCommands ;
7+
8+ class RegisterDockerCommands
9+ {
10+ protected static $ commands = [
11+ 'build ' => 'Build or rebuild services. ' ,
12+ 'config ' => 'Parse, resolve and render compose file in canonical format. ' ,
13+ 'cp ' => 'Copy files/folders between a service container and the local filesystem. ' ,
14+ 'create ' => 'Creates containers for a service. ' ,
15+ 'down ' => 'Stop and remove containers, networks. ' ,
16+ 'events ' => 'Receive real time events from containers. ' ,
17+ 'exec ' => 'Execute a command in a running container. ' ,
18+ 'images ' => 'List images used by the created containers. ' ,
19+ 'kill ' => 'Force stop service containers. ' ,
20+ 'logs ' => 'View output from containers. ' ,
21+ 'ls ' => 'List running compose projects. ' ,
22+ 'pause ' => 'Pause services. ' ,
23+ 'port ' => 'Print the public port for a port binding. ' ,
24+ 'ps ' => 'List containers. ' ,
25+ 'pull ' => 'Pull service images. ' ,
26+ 'push ' => 'Push service images ' ,
27+ 'restart ' => 'Restart service containers. ' ,
28+ 'rm ' => 'Removes stopped service containers. ' ,
29+ 'run ' => 'Run a one-off command on a service. ' ,
30+ 'start ' => 'Start services. ' ,
31+ 'stop ' => 'Stop services. ' ,
32+ 'top ' => 'Display the running processes. ' ,
33+ 'unpause ' => 'Unpause services. ' ,
34+ 'up ' => 'Create and start containers. ' ,
35+ 'version ' => 'Show the Docker Compose version information. ' ,
36+ ];
37+
38+ public static function register (Application $ app , $ prefix = 'runtime ' )
39+ {
40+ foreach (static ::$ commands as $ name => $ description ) {
41+ $ app ->add (new RunDockerCommands ($ prefix . ': ' . $ name , $ description ));
42+ }
43+ }
44+ }
0 commit comments