dockercompat

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package dockercompat mimics `docker inspect` objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	ID             string `json:"Id"`
	Created        string
	Path           string
	Args           []string
	State          *ContainerState
	Image          string
	ResolvConfPath string
	// TODO: HostnamePath   string
	// TODO: HostsPath      string
	LogPath string
	// Unimplemented: Node            *ContainerNode `json:",omitempty"` // Node is only propagated by Docker Swarm standalone API
	Name string
	// TODO: RestartCount int
	Driver   string
	Platform string
	// TODO: MountLabel      string
	// TODO: ProcessLabel    string
	AppArmorProfile string

	// TODO: Mounts          []MountPoint
	// TODO: Config          *container.Config
	NetworkSettings *NetworkSettings
}

Container mimics a `docker container inspect` object. From https://github.com/moby/moby/blob/v20.10.1/api/types/types.go#L340-L374

func ContainerFromNative

func ContainerFromNative(n *native.Container) (*Container, error)

ContainerFromNative instantiates a Docker-compatible Container from containerd-native Container.

type ContainerState

type ContainerState struct {
	Status  string // String representation of the container state. Can be one of "created", "running", "paused", "restarting", "removing", "exited", or "dead"
	Running bool
	Paused  bool
	// TODO:	Restarting bool
	// TODO: OOMKilled  bool
	// TODO:	Dead       bool
	Pid      int
	ExitCode int
	// TODO: Error      string
	// TODO: StartedAt  string
	FinishedAt string
}

ContainerState is from https://github.com/moby/moby/blob/v20.10.1/api/types/types.go#L313-L326

type DefaultNetworkSettings

type DefaultNetworkSettings struct {
	// TODO EndpointID          string // EndpointID uniquely represents a service endpoint in a Sandbox
	// TODO Gateway             string // Gateway holds the gateway address for the network
	GlobalIPv6Address   string // GlobalIPv6Address holds network's global IPv6 address
	GlobalIPv6PrefixLen int    // GlobalIPv6PrefixLen represents mask length of network's global IPv6 address
	IPAddress           string // IPAddress holds the IPv4 address for the network
	IPPrefixLen         int    // IPPrefixLen represents mask length of network's IPv4 address
	// TODO IPv6Gateway         string // IPv6Gateway holds gateway address specific for IPv6
	MacAddress string // MacAddress holds the MAC address for the network
}

DefaultNetworkSettings is from https://github.com/moby/moby/blob/v20.10.1/api/types/types.go#L405-L414

type NetworkEndpointSettings

type NetworkEndpointSettings struct {
	// Configurations
	// TODO IPAMConfig *EndpointIPAMConfig
	// TODO Links      []string
	// TODO Aliases    []string
	// Operational data
	// TODO NetworkID           string
	// TODO EndpointID          string
	// TODO Gateway             string
	IPAddress   string
	IPPrefixLen int
	// TODO IPv6Gateway         string
	GlobalIPv6Address   string
	GlobalIPv6PrefixLen int
	MacAddress          string
}

NetworkEndpointSettings is from https://github.com/moby/moby/blob/v20.10.1/api/types/network/network.go#L49-L65

type NetworkSettings

type NetworkSettings struct {
	DefaultNetworkSettings
	Networks map[string]*NetworkEndpointSettings
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL