Skip to content

Commit 7cf30dd

Browse files
committed
Grant bake read access to the repository root in docker:push
docker buildx bake asks for an interactive confirmation when a build context lives outside of the directory of the bake (compose) files, like an additional "app" context pointing to the repository root. As castor runs the command with a pty, the CI job then waits forever for an answer. Pass --allow=fs.read=<root_dir> explicitly.
1 parent eacd162 commit 7cf30dd

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎.castor/docker.php‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,10 @@ function push(bool $dryRun = false): void
562562
->withWorkingDirectory(variable('root_dir') . '/infrastructure/docker')
563563
;
564564

565-
$command = ['docker', 'buildx', 'bake'];
565+
// Additional build contexts may live outside of the compose files directory (e.g. the
566+
// repository root): grant bake the read access explicitly, or it asks for it interactively
567+
// (and waits forever in the CI, castor running it with a pty)
568+
$command = ['docker', 'buildx', 'bake', '--allow=fs.read=' . variable('root_dir')];
566569

567570
foreach ($c['docker_compose_files'] as $file) {
568571
$command[] = '-f';

0 commit comments

Comments
 (0)