File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,15 @@ type dockerfileMetadata struct {
25
25
Froms []string // every "FROM" or "COPY --from=xxx" value (minus named and/or numbered stages in the case of "--from=")
26
26
}
27
27
28
+ // this returns the "FROM" value for the last stage (which essentially determines the "base" for the final published image)
29
+ func (r Repo ) ArchLastStageFrom (arch string , entry * manifest.Manifest2822Entry ) (string , error ) {
30
+ dockerfileMeta , err := r .archDockerfileMetadata (arch , entry )
31
+ if err != nil {
32
+ return "" , err
33
+ }
34
+ return dockerfileMeta .StageFroms [len (dockerfileMeta .StageFroms )- 1 ], nil
35
+ }
36
+
28
37
func (r Repo ) DockerFroms (entry * manifest.Manifest2822Entry ) ([]string , error ) {
29
38
return r .ArchDockerFroms (arch , entry )
30
39
}
You can’t perform that action at this time.
0 commit comments