Slide 49
Slide 49 text
// devkit/Infra/Command/DockerCompose.php
/**
* Define and run multi-container applications with Docker.
*/
class DockerCompose
{
/**
* build: Build or rebuild services.
*/
public static function build(?string $service = null, ?string $command = null,
array $options = []): DockerRemoteCommand
{
return self::buildDockerCommand('build', $service, $command, $options);
}
/**
* exec: Execute a command in a running container.
*/
public static function exec(string $service, string $command,
array $options = []): DockerRemoteCommand
{
return self::buildDockerCommand('exec', $service, $command, $options);
}
/**
* run: Run a one-off command.
*/
public static function run(string $service, string $command,
array $options = []): DockerRemoteCommand
{
return self::buildDockerCommand('run --rm', $service, $command, $options);
}
// ...