Skip to content

Commit

Permalink
[backend] track base containers over multiple stages
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Sep 10, 2024
1 parent be54328 commit 69ed176
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Build/Docker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,9 @@ sub parse {
if ($cmd eq 'FROM') {
shift @args if @args && $args[0] =~ /^--platform=/;
$basecontainer = undef;
if (@args && !$as_container{$args[0]}) {
$as_container{$args[2]} = $args[0] if @args > 2 && lc($args[1]) eq 'as';
if (@args && $as_container{$args[0]}) {
$basecontainer = $as_container{$args[0]}->[1];
} elsif (@args && !$as_container{$args[0]}) {
my $container = $args[0];
if ($container ne 'scratch') {
if ($Build::Kiwi::urlmapper && $container =~ /^([^\/]+\.[^\/]+)\/[a-zA-Z0-9]/) {
Expand All @@ -355,6 +356,7 @@ sub parse {
$basecontainer = $container;
push @{$ret->{'deps'}}, $container unless grep {$_ eq $container} @{$ret->{'deps'}};
}
$as_container{$args[2]} = [ $args[0], $basecontainer ] if @args > 2 && lc($args[1]) eq 'as';
}
$vars_env = {}; # should take env from base container
$vars = { %$vars_env };
Expand Down

0 comments on commit 69ed176

Please sign in to comment.