Documentation ¶
Index ¶
- func ContainerNetNSPath(ctx context.Context, c containerd.Container) (string, error)
- func ContainerStatus(ctx context.Context, c containerd.Container) (containerd.Status, error)
- func CopyFiles(ctx context.Context, container2host bool, pid int, dst, src string, ...) error
- func GenerateSharingPIDOpts(ctx context.Context, targetCon containerd.Container) ([]oci.SpecOpts, error)
- func Pause(ctx context.Context, client *containerd.Client, id string) error
- func PrintHostPort(ctx context.Context, writer io.Writer, container containerd.Container, ...) error
- func ReconfigNetContainer(ctx context.Context, c containerd.Container, client *containerd.Client, ...) error
- func ReconfigPIDContainer(ctx context.Context, c containerd.Container, client *containerd.Client, ...) error
- func Start(ctx context.Context, container containerd.Container, flagA bool, ...) error
- func Stop(ctx context.Context, container containerd.Container, timeout *time.Duration) error
- func Unpause(ctx context.Context, client *containerd.Client, id string) error
- func UpdateExplicitlyStoppedLabel(ctx context.Context, container containerd.Container, explicitlyStopped bool) error
- func WithBindMountHostProcfs(_ context.Context, _ oci.Client, _ *containers.Container, s *oci.Spec) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainerNetNSPath ¶ added in v1.2.0
ContainerNetNSPath returns the netns path of a container.
func ContainerStatus ¶ added in v1.2.0
func ContainerStatus(ctx context.Context, c containerd.Container) (containerd.Status, error)
ContainerStatus returns the container's status from its task.
func CopyFiles ¶ added in v1.2.1
func CopyFiles(ctx context.Context, container2host bool, pid int, dst, src string, followSymlink bool) error
CopyFiles implements `nerdctl cp`.
See https://docs.docker.com/engine/reference/commandline/cp/ for the specification.
func GenerateSharingPIDOpts ¶ added in v1.2.0
func GenerateSharingPIDOpts(ctx context.Context, targetCon containerd.Container) ([]oci.SpecOpts, error)
GenerateSharingPIDOpts returns the oci.SpecOpts that shares the host linux namespace from `targetCon` If `targetCon` doesn't have a `PIDNamespace`, a new one is generated from its `Pid`.
func PrintHostPort ¶
func PrintHostPort(ctx context.Context, writer io.Writer, container containerd.Container, containerPort int, proto string) error
PrintHostPort writes to `writer` the public (HostIP:HostPort) of a given `containerPort/protocol` in a container. if `containerPort < 0`, it writes all public ports of the container.
func ReconfigNetContainer ¶ added in v1.2.0
func ReconfigNetContainer(ctx context.Context, c containerd.Container, client *containerd.Client, lab map[string]string) error
ReconfigNetContainer reconfigures the container's network namespace path.
func ReconfigPIDContainer ¶ added in v1.2.0
func ReconfigPIDContainer(ctx context.Context, c containerd.Container, client *containerd.Client, lab map[string]string) error
ReconfigPIDContainer reconfigures the container's spec options for sharing PID namespace.
func Start ¶ added in v1.2.0
func Start(ctx context.Context, container containerd.Container, flagA bool, client *containerd.Client) error
Start starts `container` with `attach` flag. If `attach` is true, it will attach to the container's stdio.
func Stop ¶ added in v1.2.0
Stop stops `container` by sending SIGTERM. If the container is not stopped after `timeout`, it sends a SIGKILL.
func UpdateExplicitlyStoppedLabel ¶ added in v1.2.0
func UpdateExplicitlyStoppedLabel(ctx context.Context, container containerd.Container, explicitlyStopped bool) error
UpdateExplicitlyStoppedLabel updates the "containerd.io/restart.explicitly-stopped" label of the container according to the value of explicitlyStopped.
func WithBindMountHostProcfs ¶ added in v1.2.0
func WithBindMountHostProcfs(_ context.Context, _ oci.Client, _ *containers.Container, s *oci.Spec) error
WithBindMountHostProcfs replaces procfs mount with rbind. Required for --pid=host on rootless.
https://github.com/moby/moby/pull/41893/files https://github.com/containers/podman/blob/v3.0.0-rc1/pkg/specgen/generate/oci.go#L248-L257
Types ¶
This section is empty.