Add ONBUILD support to --change

Return types had to change a bit for this, but since we can wrap
the old v1.ImageConfig, changes are overall not particularly bad.

At present, I believe this only works with commit, not import.
This matches how things were before we changed to the new parsing
so I think this is fine.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
Matthew Heon
2019-12-05 15:11:40 -05:00
parent c4fbd2fc94
commit 60bfa305a8
5 changed files with 53 additions and 18 deletions

View File

@ -183,6 +183,9 @@ func (c *Container) Commit(ctx context.Context, destImage string, options Contai
if newImageConfig.StopSignal != "" {
importBuilder.SetStopSignal(newImageConfig.StopSignal)
}
for _, onbuild := range newImageConfig.OnBuild {
importBuilder.SetOnBuild(onbuild)
}
candidates, _, _, err := util.ResolveName(destImage, "", sc, c.runtime.store)
if err != nil {