Documentation ¶
Index ¶
- func CreateContainer(runtimeRoot string, id string, bundle string, spec *specs.Spec, network string, ...) (libcapsule.Container, error)
- func CreateOrRunContainer(runtimeRoot string, id string, bundle string, spec *specs.Spec, ...) error
- func ExecContainer(runtimeRoot string, id string, detach bool, args []string, cwd string, ...) (string, error)
- func GetContainer(runtimeRoot, id string) (libcapsule.Container, error)
- func GetContainerIds(runtimeRoot string) ([]string, error)
- func LoadSpec(bundle string) (spec *specs.Spec, err error)
- type ContainerAction
- type ContainerStateVO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateContainer ¶
func CreateContainer(runtimeRoot string, id string, bundle string, spec *specs.Spec, network string, portMappings []string) (libcapsule.Container, error)
创建容器实例
func CreateOrRunContainer ¶
func CreateOrRunContainer(runtimeRoot string, id string, bundle string, spec *specs.Spec, action ContainerAction, detach bool, network string, portMappings []string) error
创建或启动容器 create or create and start Process一定为Init Process
func ExecContainer ¶
func ExecContainer(runtimeRoot string, id string, detach bool, args []string, cwd string, env []string) (string, error)
进入容器执行一个Process
func GetContainer ¶
func GetContainer(runtimeRoot, id string) (libcapsule.Container, error)
根据id读取一个Container
Types ¶
type ContainerAction ¶
type ContainerAction uint8
const ( ContainerActCreate ContainerAction = iota ContainerActRun )
func (ContainerAction) String ¶
func (action ContainerAction) String() string
type ContainerStateVO ¶
type ContainerStateVO struct { // Version is the OCI version for the container Version string `json:"ociVersion"` // ID is the container ID ID string `json:"id"` // InitProcessPid is the init process id in the parent namespace InitProcessPid int `json:"pid"` // ContainerStatus is the current status of the container, running, paused, ... Status string `json:"status"` // Bundle is the path on the filesystem to the bundle Bundle string `json:"bundle"` // Rootfs is a path to a directory containing the container's root filesystem. Rootfs string `json:"rootfs"` // IP is container veth ip address IP string `json:"ip"` // Created is the unix timestamp for the creation time of the container in UTC Created time.Time `json:"created"` // GetAnnotations is the user defined annotations added to the config. Annotations map[string]string `json:"annotations,omitempty"` Detail *libcapsule.StateStorage `json:"detail"` }
state represents the platform agnostic pieces relating to a running container's status and state
func GetContainerStateVO ¶
func GetContainerStateVO(runtimeRoot string, id string) (*ContainerStateVO, error)
func GetContainerStateVOs ¶
func GetContainerStateVOs(runtimeRoot string, ids []string) ([]*ContainerStateVO, error)
Click to show internal directories.
Click to hide internal directories.