Skip to content

Commit

Permalink
CustomService options update
Browse files Browse the repository at this point in the history
  • Loading branch information
Ph3nol committed Oct 16, 2017
1 parent 4e88090 commit 3ef3fad
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/custom-image-project/.docker-arch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ name: Docker Arch - Custom Image Project
services:
# SFTP Container (connect from `sftp -P 2222 docker-arch@localhost`, password: unicorn)
- type: custom
identifier: sftp
options:
image: "atmoz/sftp:alpine"
package_manager: apk
cli: true
container:
cmd:
- "docker-arch:unicorn:1001"
ports:
- "2222:22"
- "${SFTP_PORT:-2222}:22"
29 changes: 29 additions & 0 deletions src/Application/Service/CustomService.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,36 @@ public function getOptionsResolver(): Options
DockerContainerInterface::PACKAGE_MANAGER_TYPE_APTITUTDE,
DockerContainerInterface::PACKAGE_MANAGER_TYPE_APK,
]);
$resolver->setDefaults([
'cli' => false,
'vhost' => false,
'web' => false,
]);

return $resolver;
}

/**
* {@inheritdoc}
*/
public function isVhost(): bool
{
return true === $this->getOptions()['vhost'];
}

/**
* {@inheritdoc}
*/
public function isWeb(): bool
{
return true === $this->getOptions()['web'];
}

/**
* {@inheritdoc}
*/
public function isCli(): bool
{
return true === $this->getOptions()['cli'];
}
}

0 comments on commit 3ef3fad

Please sign in to comment.