mirror of
https://github.com/containers/podman.git
synced 2025-06-17 23:20:59 +08:00
18 lines
448 B
Go
18 lines
448 B
Go
// +build varlink
|
|
|
|
package varlinkapi
|
|
|
|
import (
|
|
iopodman "github.com/containers/podman/v2/pkg/varlink"
|
|
)
|
|
|
|
// CreateContainer ...
|
|
func (i *VarlinkAPI) CreateContainer(call iopodman.VarlinkCall, config iopodman.Create) error {
|
|
generic := VarlinkCreateToGeneric(config)
|
|
ctr, _, err := CreateContainer(getContext(), &generic, i.Runtime)
|
|
if err != nil {
|
|
return call.ReplyErrorOccurred(err.Error())
|
|
}
|
|
return call.ReplyCreateContainer(ctr.ID())
|
|
}
|