diff options
-rw-r--r-- | cmd/podman/build.go | 6 | ||||
-rw-r--r-- | libpod/info.go | 5 | ||||
-rw-r--r-- | pkg/spec/config_linux.go | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/cmd/podman/build.go b/cmd/podman/build.go index 880cb892f..02a125aab 100644 --- a/cmd/podman/build.go +++ b/cmd/podman/build.go @@ -205,6 +205,10 @@ func buildCmd(c *cli.Context) error { } namespaceOptions.AddOrReplace(usernsOption...) + ociruntime := runtime.GetOCIRuntimePath() + if c.IsSet("runtime") { + ociruntime = c.String("runtime") + } options := imagebuildah.BuildOptions{ ContextDirectory: contextDir, PullPolicy: pullPolicy, @@ -217,7 +221,7 @@ func buildCmd(c *cli.Context) error { Out: stdout, Err: stderr, ReportWriter: reporter, - Runtime: c.String("runtime"), + Runtime: ociruntime, RuntimeArgs: runtimeFlags, OutputFormat: format, SystemContext: systemContext, diff --git a/libpod/info.go b/libpod/info.go index 5d8d160c8..7044eba6a 100644 --- a/libpod/info.go +++ b/libpod/info.go @@ -180,6 +180,11 @@ func (r *Runtime) GetConmonVersion() (string, error) { return strings.TrimSuffix(strings.Replace(output, "\n", ", ", 1), "\n"), nil } +// GetOCIRuntimePath returns the path to the OCI Runtime Path the runtime is using +func (r *Runtime) GetOCIRuntimePath() string { + return r.ociRuntimePath +} + // GetOCIRuntimeVersion returns a string representation of the oci runtimes version func (r *Runtime) GetOCIRuntimeVersion() (string, error) { output, err := utils.ExecCmd(r.ociRuntimePath, "--version") diff --git a/pkg/spec/config_linux.go b/pkg/spec/config_linux.go index f3e200262..eccd41ff9 100644 --- a/pkg/spec/config_linux.go +++ b/pkg/spec/config_linux.go @@ -74,7 +74,7 @@ func devicesFromPath(g *generate.Generator, devicePath string) error { return nil } - return addDevice(g, devicePath) + return addDevice(g, strings.Join(append([]string{resolvedDevicePath}, devs[1:]...), ":")) } func addDevice(g *generate.Generator, device string) error { |