Documentation
¶
Overview ¶
Package docker_api
Deprecated
Index ¶
- Constants
- Variables
- func DecE(b []byte, v any) error
- func EncE(v any) ([]byte, error)
- type Artifact
- func (a *Artifact) AbsDigestStr() string
- func (a *Artifact) AbsRefStr() string
- func (a *Artifact) DigestStr() string
- func (a *Artifact) RefStr() string
- func (a *Artifact) SetArtifact(s string) *Artifact
- func (a *Artifact) SetDigest(s string) *Artifact
- func (a *Artifact) SetName(s string) *Artifact
- func (a *Artifact) SetProject(s string) *Artifact
- func (a *Artifact) SetRegistry(s string) *Artifact
- func (a *Artifact) SetTag(s string) *Artifact
- func (a *Artifact) ValidAbsRefStr() bool
- type BuildImageRespV1
- type BuildImageRespV2
- type BuildOutput
- type ClearImage
- type Client
- func (c *Client) BuildImage(input io.Reader, refStr string) (resp BuildImageRespV1, err error)
- func (c *Client) BuildImageFavOption(refStr string) types.ImageBuildOptions
- func (c *Client) BuildImageV2(input io.Reader, refStr string) (resp BuildImageRespV1, err error)
- func (c *Client) BuildImageV3(ctx context.Context, input io.Reader, options types.ImageBuildOptions) (resp BuildImageRespV2, err error)
- func (c *Client) BuildImageV4(ctx context.Context, input io.Reader, options types.ImageBuildOptions) (resp BuildImageRespV1, err error)
- func (c *Client) BuildImageWithCancel(ctx context.Context, input io.Reader, refStr string) (resp BuildImageRespV1, cancelFunc *context.CancelFunc, err error)
- func (c *Client) CreateImageTag(toAbsRefStr, fromAbsRefStr string) (io.ReadCloser, error)
- func (c *Client) CreateImageTagV2(toAbsRefStr, fromAbsRefStr string) (resp PushImageOfficialAPIResp, err error)
- func (c *Client) CreateImageTagV3(toAbsRefStr, fromAbsRefStr string) (resp docker_client.EventResp, err error)
- func (c *Client) Do(fc func(cli *dockercli.Client) error) error
- func (c *Client) ExportImage(absRefStr string) (resp ExportImageResp, err error)
- func (c *Client) ExportImageV2(absRefStr string) (resp ExportImageRespV2, err error)
- func (c *Client) GC(gc ...util.Func)
- func (c *Client) GetAPIProvider() api_provider.APIProvider
- func (c *Client) HostImageStorageGC(gcFunc ...HostImageGCFunc)
- func (c *Client) ImagePrune(clearImage ClearImage) (image.PruneReport, error)
- func (c *Client) ImportImage(absRefStr string, input io.Reader) (resp ImportImageResp, err error)
- func (c *Client) ImportImageV2(absRefStr string, input io.Reader) (resp ImportImageResp, err error)
- func (c *Client) ImportImageV3(absRefStr string, input io.Reader) (resp ImportImageRespV3, err error)
- func (c *Client) InspectImage(image string) (types.ImageInspect, error)
- func (c *Client) ListContainerIds() ([]string, error)
- func (c *Client) ListContainerNames() ([]string, error)
- func (c *Client) ListContainers() ([]types.Container, error)
- func (c *Client) RegistryAuth(config *registry.AuthConfig) (string, error)
- func (c *Client) SystemDF(objectTypes ...types.DiskUsageObject) (types.DiskUsage, error)
- func (c *Client) SystemEvent(show ShowEvent) (<-chan events.Message, <-chan error)
- func (c *Client) SystemInfo() (dockersystem.Info, error)
- func (c *Client) SystemPing() (types.Ping, error)
- func (c *Client) SystemVersion() (types.Version, error)
- func (c *Client) WithContext(ctx context.Context) *Client
- func (c *Client) WithPage(page *util.Page) *Client
- func (c *Client) WithProject(project string) *Client
- func (c *Client) WithRegistryAuth(authConfig *registry.AuthConfig) *Client
- type ExportImageResp
- type ExportImageRespV2
- type Filter
- type HostImageGCFunc
- type ImportImageResp
- type ImportImageRespV3
- type PushImageOfficialAPIResp
- type ShowCRT
- type ShowEvent
- type TagPushImageResp
Constants ¶
const ( /* os[/arch[/variant]] */ PlatformLinuxAmd64 = internal_api.Linux + "/" + internal_api.Amd64 PlatformLinuxArm64 = internal_api.Linux + "/" + internal_api.Arm64 PlatformDarwinArm64 = internal_api.Darwin + "/" + internal_api.Arm64 PlatformDarwinAmd64 = internal_api.Darwin + "/" + internal_api.Amd64 PlatformWindowsAmd64 = internal_api.Windows + "/" + internal_api.Amd64 )
const ( NetworkBridge = "bridge" NetworkHost = "host" NetworkNone = "none" )
const ( OutputLocal = buildkitclient.ExporterLocal OutputTar = buildkitclient.ExporterTar OutputOCI = buildkitclient.ExporterOCI OutputDocker = buildkitclient.ExporterDocker OutputImage = buildkitclient.ExporterImage OutputRegistry = "registry" OutputMoby = exporter.Moby )
const ( LabelEventType events.Type = "label" ScopeEventType events.Type = "scope" ScopeLocal = "local" ScopeSwarm = "swarm" )
const (
DockerfileDefault = "Dockerfile"
)
const (
TagLatest = "latest"
)
Variables ¶
var ErrAbsRefStr = errors.New("image absolutely refStr format error")
var ErrNotFoundImageAnyWhere = errors.New("not found image refStr in anywhere")
var ErrProjectNotFound = errors.New("project not found error")
Functions ¶
Types ¶
type Artifact ¶ added in v1.2.35
type Artifact struct {
// ex. docker.io
Registry string
// ex. Dockerhub is username, Harbor is project
Project string
// must use Artifact.SetName
Name string
// must use Artifact.SetTag
Tag string
// must use Artifact.SetDigest
Digest string
// contains filtered or unexported fields
}
func ParseToArtifact ¶ added in v1.2.35
ParseToArtifact +example: jammy-env +example: jammy-env:v1.6 +example: library/jammy-env:v1.6 +example: harbor.local:8080/library/jammy-env:v1.6 +example: harbor.local:8080/library/jammy-env@sha256:305243c734571da2d100c8c8b3c3167a098cab6049c9a5b066b6021a60fcb966
func (*Artifact) AbsDigestStr ¶ added in v1.2.35
func (*Artifact) SetArtifact ¶ added in v1.2.35
func (*Artifact) SetDigest ¶ added in v1.2.35
+example: @sha256:305243c734571da2d100c8c8b3c3167a098cab6049c9a5b066b6021a60fcb966 +example: sha256:305243c734571da2d100c8c8b3c3167a098cab6049c9a5b066b6021a60fcb966
func (*Artifact) SetProject ¶ added in v1.2.35
+example: /library/ +example: library
func (*Artifact) SetRegistry ¶ added in v1.2.35
+example: http://harbor.local:8080 +example: harbor.local:8080/ +example: harbor.local:8080
func (*Artifact) ValidAbsRefStr ¶ added in v1.2.41
type BuildImageRespV1 ¶ added in v1.2.35
type BuildImageRespV1 struct {
docker_client.ImageBuildResp `json:"build_image"`
TagPushImageResp `json:"tag_push_image"`
OSType string `json:"os_type"`
}
type BuildImageRespV2 ¶ added in v1.2.41
type BuildImageRespV2 struct {
docker_client.ImageBuildResp `json:"build_image"`
}
type BuildOutput ¶ added in v1.2.41
type BuildOutput struct {
Local []string // destination directory where files will be written
Tar []string // destination path where tarball will be written. “-” writes to stdout.
OCI []string // destination path where tarball will be written. “-” writes to stdout.
Docker []struct {
Dest string // destination path where tarball will be written. If not specified, the tar will be loaded automatically to the local image store.
Context string // name for the Docker context where to import the result
}
Image []struct {
Name string // name (references) for the new image.
Push bool // Boolean to automatically push the image.
}
Registry bool // The registry exporter is a shortcut for type=image,push=true.
}
type ClearImage ¶ added in v1.2.41
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewWithOpts ¶ added in v1.2.51
func (*Client) BuildImage ¶ added in v1.2.35
func (*Client) BuildImageFavOption ¶ added in v1.2.35
func (c *Client) BuildImageFavOption(refStr string) types.ImageBuildOptions
func (*Client) BuildImageV2 ¶ added in v1.2.40
func (*Client) BuildImageV3 ¶ added in v1.2.41
func (c *Client) BuildImageV3(ctx context.Context, input io.Reader, options types.ImageBuildOptions) ( resp BuildImageRespV2, err error)
func (*Client) BuildImageV4 ¶ added in v1.2.41
func (c *Client) BuildImageV4( ctx context.Context, input io.Reader, options types.ImageBuildOptions) ( resp BuildImageRespV1, err error)
func (*Client) BuildImageWithCancel ¶ added in v1.2.38
func (c *Client) BuildImageWithCancel(ctx context.Context, input io.Reader, refStr string) ( resp BuildImageRespV1, cancelFunc *context.CancelFunc, err error)
func (*Client) CreateImageTag ¶ added in v1.1.3
func (c *Client) CreateImageTag(toAbsRefStr, fromAbsRefStr string) (io.ReadCloser, error)
func (*Client) CreateImageTagV2 ¶ added in v1.2.31
func (c *Client) CreateImageTagV2(toAbsRefStr, fromAbsRefStr string) (resp PushImageOfficialAPIResp, err error)
func (*Client) CreateImageTagV3 ¶ added in v1.2.34
func (c *Client) CreateImageTagV3(toAbsRefStr, fromAbsRefStr string) (resp docker_client.EventResp, err error)
func (*Client) ExportImage ¶ added in v1.1.3
func (c *Client) ExportImage(absRefStr string) (resp ExportImageResp, err error)
ExportImage +param absRefStr (1). absolutely reference string for registry/project/repository/artifact/name:tag +desc
(1).if image do not exist in docker host local, pull image to local (2).get image id by absRefStr (3).save image to docker host local get io.ReadCloser fd
func (*Client) ExportImageV2 ¶ added in v1.2.34
func (c *Client) ExportImageV2(absRefStr string) (resp ExportImageRespV2, err error)
func (*Client) GetAPIProvider ¶ added in v1.2.41
func (c *Client) GetAPIProvider() api_provider.APIProvider
func (*Client) HostImageStorageGC ¶ added in v1.1.4
func (c *Client) HostImageStorageGC(gcFunc ...HostImageGCFunc)
HostImageGC cli: docker rmi IMAGE_ID maybe quota by:
1. image CREATED: since, before 2. image SIZE: bytes(B) 3. cache algorithm policy: lru, lfu 4. host disk: bytes(B)
func (*Client) ImagePrune ¶ added in v1.2.41
func (c *Client) ImagePrune(clearImage ClearImage) (image.PruneReport, error)
func (*Client) ImportImage ¶ added in v1.1.3
ImportImage +param input
(1). make sure the input file(.tar.gz) metadata attribute image name format is: registry/project/image_name:image_tag
(1.1). or will create new image tag to local
(2). push image to registry
func (*Client) ImportImageV2 ¶ added in v1.2.31
func (*Client) ImportImageV3 ¶ added in v1.2.34
func (*Client) InspectImage ¶ added in v1.1.4
func (c *Client) InspectImage(image string) (types.ImageInspect, error)
InspectImage +param image: sha256ID or refStr
func (*Client) ListContainerIds ¶
func (*Client) ListContainerNames ¶
func (*Client) RegistryAuth ¶ added in v1.1.4
func (c *Client) RegistryAuth(config *registry.AuthConfig) (string, error)
func (*Client) SystemEvent ¶ added in v1.2.41
func (*Client) SystemInfo ¶ added in v1.2.41
func (c *Client) SystemInfo() (dockersystem.Info, error)
func (*Client) SystemVersion ¶ added in v1.2.41
func (*Client) WithProject ¶ added in v1.2.35
func (*Client) WithRegistryAuth ¶ added in v1.1.4
func (c *Client) WithRegistryAuth(authConfig *registry.AuthConfig) *Client
type ExportImageResp ¶ added in v1.2.31
type ExportImageResp struct {
RequestRefStr string
NotFoundInRegistry bool // absRefStr not found in provided registry.
NotFoundInLocal bool // absRefStr not found in docker-server local.
// deprecated in Client.ExportImageV2
ImagePulledInfo string // image pulled information from provided registry.
ImageFileReader io.ReadCloser `json:"-"` // compressed (.tar, .tar.gz) file reader, It's up to the caller to handle the io.ReadCloser and close it properly.
}
type ExportImageRespV2 ¶ added in v1.2.34
type ExportImageRespV2 struct {
ExportImageResp
docker_client.ImagePullResp
}
type Filter ¶ added in v1.2.41
Filter config=<string> config name or ID container=<string> container name or ID daemon=<string> daemon name or ID event=<string> event type image=<string> image name or ID label=<string> image or container label network=<string> network name or ID node=<string> node ID plugin= plugin name or ID scope= local or swarm secret=<string> secret name or ID service=<string> service name or ID type=<string> object to filter by, one of container, image, volume, network, daemon, plugin, node, service, secret or config volume=<string> volume name
type HostImageGCFunc ¶ added in v1.1.3
type ImportImageResp ¶ added in v1.2.31
type ImportImageResp struct {
RequestRefStr string
LoadedRefStr string
// +disable in Client.ImportImageV2
PushStatus string
PushDigest string
Inspect types.ImageInspect
PushResp PushImageOfficialAPIResp
}
type ImportImageRespV3 ¶ added in v1.2.34
type ImportImageRespV3 struct {
RequestRefStr string
LoadedRefStr string
Inspect types.ImageInspect
PushResp docker_client.ImagePushResp
}
type PushImageOfficialAPIResp ¶ added in v1.2.31
type PushImageOfficialAPIResp struct {
Messages []*jsonmessage.JSONMessage
Aux []*map[string]any //jsonmessage.JSONMessage .Aux -> []byte -> map[string]any
}
func (*PushImageOfficialAPIResp) GetDigest ¶ added in v1.2.31
func (r *PushImageOfficialAPIResp) GetDigest() string
func (*PushImageOfficialAPIResp) GetSize ¶ added in v1.2.31
func (r *PushImageOfficialAPIResp) GetSize() string
func (*PushImageOfficialAPIResp) Parse ¶ added in v1.2.31
func (r *PushImageOfficialAPIResp) Parse(jsonStrSplitByLineFeed string)
type ShowCRT ¶ added in v1.2.41
type ShowCRT struct {
// Fuzzy match
// container from ancestor image
Image sets.String // ancestor=(<image-name>[:<tag>], <image id>, or <image@digest>)
// container network
EPort sets.String // expose=(<port>[/<proto>]|<startport-endport>/[<proto>])
PPort sets.String // publish=(<port>[/<proto>]|<startport-endport>/[<proto>])
Network sets.String // network=(<network id> or <network name>)
// container volume
Volume sets.String // volume=(<volume name> or <mount point destination>)
// container state
Health sets.String // health=(starting|healthy|unhealthy|none)
Status sets.String // status=(created|restarting|running|removing|paused|exited|dead)
ExitedCode set.Set[int] // exited=<int> containers with exit code of <int>
// container start timeline
Before string // before=(<container id> or <container name>)
Since string // since=(<container id> or <container name>)
Isolation sets.String // isolation=(default|process|hyperv) (Windows daemon only)
Task bool // is-task=(true|false)
Label map[string]string // label=key or label="key=value" of a container label
// Exact match
ID sets.String // id=<ID> a container's ID
Name sets.String // name=<name> a container's name
}
ShowCRT show container runtime
type TagPushImageResp ¶ added in v1.2.35
type TagPushImageResp struct {
Artifact
docker_client.ImagePushResp
}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package docker_inst/client.go was generated by codegen, please fix its package dependency, but do not modify its functionality
|
Package docker_inst/client.go was generated by codegen, please fix its package dependency, but do not modify its functionality |