mirror of
https://github.com/containers/podman
synced 2024-10-20 17:23:30 +00:00
ba65301c95
add the ability to create and run containers via the podman-remote client. we now create an intermediate layer from the the create/run cli flags. the intermediate layer can be converted into a createconfig or into a varlink struct. Once transported, the varlink struct can be converted back to an intermediate layer and then to a createconfig. remote terminals are not supported yet. Signed-off-by: baude <bbaude@redhat.com>
19 lines
506 B
Go
19 lines
506 B
Go
// +build varlink
|
|
|
|
package varlinkapi
|
|
|
|
import (
|
|
"github.com/containers/libpod/cmd/podman/shared"
|
|
"github.com/containers/libpod/cmd/podman/varlink"
|
|
)
|
|
|
|
// CreateContainer ...
|
|
func (i *LibpodAPI) CreateContainer(call iopodman.VarlinkCall, config iopodman.Create) error {
|
|
generic := shared.VarlinkCreateToGeneric(config)
|
|
ctr, _, err := shared.CreateContainer(getContext(), &generic, i.Runtime)
|
|
if err != nil {
|
|
return call.ReplyErrorOccurred(err.Error())
|
|
}
|
|
return call.ReplyCreateContainer(ctr.ID())
|
|
}
|