Skip to content

Commit

Permalink
feat: added COPY --from to enable builder pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
gplanchat committed Dec 11, 2024
1 parent 0e5ef84 commit 30d818f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Dockerfile/CopyFrom.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);

namespace Kiboko\Component\Dockerfile\Dockerfile;

final readonly class CopyFrom implements LayerInterface, \Stringable
{
public function __construct(
private string $sourcePath,
private string $destinationPath,
private string $from,
) {
}

public function __toString(): string
{
return sprintf('COPY --from=%s %s %s', $this->from, $this->sourcePath, $this->destinationPath);
}
}

0 comments on commit 30d818f

Please sign in to comment.