Skip to content

Commit 000e9e9

Browse files
committed
Added commands for docker and composer
1 parent e1084b7 commit 000e9e9

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

src/Dockerfile/Arg.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Kiboko\Component\Dockerfile\Dockerfile;
6+
7+
final readonly class Arg implements LayerInterface, \Stringable
8+
{
9+
public function __construct(
10+
private string $name,
11+
) {
12+
}
13+
14+
public function __toString(): string
15+
{
16+
return sprintf('ARG %s', $this->name);
17+
}
18+
}

src/PHP/ComposerConfig.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Kiboko\Component\Dockerfile\PHP;
6+
7+
use Kiboko\Component\Dockerfile\Dockerfile;
8+
9+
final class ComposerConfig implements Dockerfile\LayerInterface, \Stringable
10+
{
11+
public function __construct(
12+
private string $host,
13+
private string $token,
14+
)
15+
{
16+
}
17+
18+
public function __toString(): string
19+
{
20+
return (string) new Dockerfile\Run(sprintf(
21+
<<<'RUN'
22+
composer config --global %s %s
23+
RUN,
24+
$this->host,
25+
$this->token,
26+
));
27+
}
28+
}

src/PHP/ComposerRequire.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function __toString(): string
1919
{
2020
return (string) new Dockerfile\Run(sprintf(<<<'RUN'
2121
set -ex \
22-
&& composer require --prefer-dist --no-progress --prefer-stable --sort-packages --optimize-autoloader --with-dependencies %s
22+
&& composer require --prefer-dist --no-progress --prefer-stable --sort-packages --optimize-autoloader --with-all-dependencies %s
2323
RUN, implode(' ', $this->packages)));
2424
}
2525
}

0 commit comments

Comments
 (0)