Merge pull request #9368 from vrothberg/fix-9365

podman build: pass runtime to buildah
This commit is contained in:
OpenShift Merge Robot
2021-02-16 08:53:27 -05:00
committed by GitHub
2 changed files with 30 additions and 0 deletions

View File

@ -166,6 +166,11 @@ func (r *Runtime) newImageBuildCompleteEvent(idOrName string) {
// Build adds the runtime to the imagebuildah call
func (r *Runtime) Build(ctx context.Context, options imagebuildah.BuildOptions, dockerfiles ...string) (string, reference.Canonical, error) {
if options.Runtime == "" {
// Make sure that build containers use the same runtime as Podman (see #9365).
conf := util.DefaultContainerConfig()
options.Runtime = conf.Engine.OCIRuntime
}
id, ref, err := imagebuildah.BuildDockerfiles(ctx, r.store, options, dockerfiles...)
// Write event for build completion
r.newImageBuildCompleteEvent(id)