package oci
import "github.com/containerd/containerd/oci"
Index ¶
- func GenerateSpec(ctx context.Context, client Client, c *containers.Container, opts ...SpecOpts) (*specs.Spec, error)
- type Client
- type Image
- type SpecOpts
- func Compose(opts ...SpecOpts) SpecOpts
- func WithEnv(environmentVariables []string) SpecOpts
- func WithHostname(name string) SpecOpts
- func WithImageConfig(image Image) SpecOpts
- func WithMounts(mounts []specs.Mount) SpecOpts
- func WithProcessArgs(args ...string) SpecOpts
- func WithProcessCwd(cwd string) SpecOpts
- func WithTTY(width, height int) SpecOpts
- func WithUsername(username string) SpecOpts
Functions ¶
func GenerateSpec ¶
func GenerateSpec(ctx context.Context, client Client, c *containers.Container, opts ...SpecOpts) (*specs.Spec, error)
GenerateSpec will generate a default spec from the provided image for use as a containerd container
Types ¶
type Client ¶
type Client interface { SnapshotService(snapshotterName string) snapshots.Snapshotter }
Client interface used by SpecOpt
type Image ¶
type Image interface { // Config descriptor for the image. Config(ctx context.Context) (ocispec.Descriptor, error) // ContentStore provides a content store which contains image blob data ContentStore() content.Store }
Image interface used by some SpecOpt to query image configuration
type SpecOpts ¶
SpecOpts sets spec specific information to a newly generated OCI spec
func Compose ¶
Compose converts a sequence of spec operations into a single operation
func WithEnv ¶
WithEnv appends environment variables
func WithHostname ¶
WithHostname sets the container's hostname
func WithImageConfig ¶
WithImageConfig configures the spec to from the configuration of an Image
func WithMounts ¶
WithMounts appends mounts
func WithProcessArgs ¶
WithProcessArgs replaces the args on the generated spec
func WithProcessCwd ¶
WithProcessCwd replaces the current working directory on the generated spec
func WithTTY ¶
WithTTY sets the information on the spec as well as the environment variables for using a TTY
func WithUsername ¶
WithUsername sets the username on the process
Source Files ¶
client.go spec.go spec_opts.go spec_opts_windows.go spec_windows.go
- Version
- v1.1.1
- Published
- Jul 9, 2018
- Platform
- windows/amd64
- Imports
- 10 packages
- Last checked
- 4 minutes ago –
Tools for package owners.