Skip to content

Commit 30d818f

Browse files
committed
feat: added COPY --from to enable builder pattern
1 parent 0e5ef84 commit 30d818f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/Dockerfile/CopyFrom.php

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

0 commit comments

Comments
 (0)