Movatterモバイル変換


[0]ホーム

URL:


daemon

package
v28.5.2+incompatibleLatest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License:Apache-2.0Imports:223Imported by:384

Details

Repository

github.com/docker/docker

Links

Documentation

Overview

Package daemon exposes the functions that occur on the host serverthat the Docker daemon is running.

In implementing the various functions of the daemon, there is oftena method-specific struct for configuring the runtime behavior.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

funcCreateDaemonRootadded inv1.13.0

func CreateDaemonRoot(config *config.Config)error

CreateDaemonRoot creates the root for the daemon

funcDefaultApparmorProfile

func DefaultApparmorProfile()string

DefaultApparmorProfile returns the name of the default apparmor profile

funcLoadOrCreateID

func LoadOrCreateID(rootstring) (string,error)

LoadOrCreateID loads the engine's ID from the given root, or generates a new IDif it doesn't exist. It returns the ID, and any error that occurred whensaving the file.

Note that this function expects the daemon's root directory to already havebeen created with the right permissions and ownership (usually this wouldbe done by daemon.CreateDaemonRoot().

funcRegisterCDIDriver

func RegisterCDIDriver(cdiSpecDirs ...string) *cdi.Cache

RegisterCDIDriver registers the CDI device driver.The driver injects CDI devices into an incoming OCI spec and is called for DeviceRequests associated with CDI devices.If the list of CDI spec directories is empty, the driver is not registered.

funcRemapContainerdNamespaces

func RemapContainerdNamespaces(config *config.Config) (nsstring, pluginNsstring, errerror)

RemapContainerdNamespaces returns the right containerd namespaces to use:- if they are not already set in the config file- and the daemon is running with user namespace remapping enabledThen it will return new namespace names, otherwise it will return the existingnamespaces

funcRootless

func Rootless(cfg *config.Config)bool

Rootless returns true if daemon is running in rootless mode

funcUsingSystemdadded inv1.11.0

func UsingSystemd(config *config.Config)bool

UsingSystemd returns true if cli option includes native.cgroupdriver=systemd

funcWithApparmor

func WithApparmor(c *container.Container)coci.SpecOpts

WithApparmor sets the apparmor profile

funcWithCapabilities

func WithCapabilities(c *container.Container)coci.SpecOpts

WithCapabilities sets the container's capabilities

funcWithConsoleSize

func WithConsoleSize(c *container.Container)coci.SpecOpts

WithConsoleSize sets the initial console size

funcWithDevices

func WithDevices(daemon *Daemon, c *container.Container)coci.SpecOpts

WithDevices sets the container's devices

funcWithNamespaces

func WithNamespaces(daemon *Daemon, c *container.Container)coci.SpecOpts

WithNamespaces sets the container's namespaces

funcWithOOMScore

func WithOOMScore(score *int)coci.SpecOpts

WithOOMScore sets the oom score

funcWithResources

func WithResources(c *container.Container)coci.SpecOpts

WithResources applies the container resources

funcWithSeccomp

func WithSeccomp(daemon *Daemon, c *container.Container)coci.SpecOpts

WithSeccomp sets the seccomp profile

funcWithSelinux

func WithSelinux(c *container.Container)coci.SpecOpts

WithSelinux sets the selinux labels

funcWithSysctls

func WithSysctls(c *container.Container)coci.SpecOpts

WithSysctls sets the container's sysctls

funcWithUser

func WithUser(c *container.Container)coci.SpecOpts

WithUser sets the container's user

Types

typeClusteradded inv1.13.0

type Cluster interface {ClusterStatusNetworkManagerSendClusterEvent(eventlncluster.ConfigEventType)}

Cluster is the interface for github.com/docker/docker/daemon/cluster.(*Cluster).

typeClusterStatus

type ClusterStatus interface {IsAgent()boolIsManager()bool}

ClusterStatus interface provides information about the Swarm status of the Cluster

typeDaemon

type Daemon struct {EventsService *events.EventsPluginStore *plugin.Store// TODO: removeReferenceStorerefstore.StoreCDICache *cdi.Cache// contains filtered or unexported fields}

Daemon holds information about the Docker daemon.

funcNewDaemon

func NewDaemon(ctxcontext.Context, config *config.Config, pluginStore *plugin.Store, authzMiddleware *authorization.Middleware) (_ *Daemon, retErrerror)

NewDaemon sets up everything for the daemon to be able to servicerequests from the webserver.

func (*Daemon)ActivateContainerServiceBindingadded inv1.13.0

func (daemon *Daemon) ActivateContainerServiceBinding(containerNamestring)error

ActivateContainerServiceBinding puts this container into load balancer active rotation and DNS response

func (*Daemon)AuthenticateToRegistryadded inv1.9.0

func (daemon *Daemon) AuthenticateToRegistry(ctxcontext.Context, authConfig *registry.AuthConfig) (string,string,error)

AuthenticateToRegistry checks the validity of credentials in authConfig

func (*Daemon)BuilderBackend

func (daemon *Daemon) BuilderBackend()builder.Backend

BuilderBackend returns the backend used by builder

func (*Daemon)CheckpointCreateadded inv1.13.0

func (daemon *Daemon) CheckpointCreate(namestring, configcheckpoint.CreateOptions)error

CheckpointCreate checkpoints the process running in a container with CRIU

func (*Daemon)CheckpointDeleteadded inv1.13.0

func (daemon *Daemon) CheckpointDelete(namestring, configcheckpoint.DeleteOptions)error

CheckpointDelete deletes the specified checkpoint

func (*Daemon)CheckpointListadded inv1.13.0

func (daemon *Daemon) CheckpointList(namestring, configcheckpoint.ListOptions) ([]checkpoint.Summary,error)

CheckpointList lists all checkpoints of the specified container

func (*Daemon)Cleanupadded inv1.10.0

func (daemon *Daemon) Cleanup(ctxcontext.Context, container *container.Container)

Cleanup releases any network resources allocated to the container along with any rulesaround how containers are linked together. It also unmounts the container's root filesystem.

func (*Daemon)Config

func (daemon *Daemon) Config()config.Config

Config returns daemon's config.

func (*Daemon)ConnectContainerToNetworkadded inv1.10.0

func (daemon *Daemon) ConnectContainerToNetwork(ctxcontext.Context, containerName, networkNamestring, endpointConfig *networktypes.EndpointSettings)error

ConnectContainerToNetwork connects the given container to the givennetwork. If either cannot be found, an err is returned. If thenetwork cannot be set up, an err is returned.

func (*Daemon)ConnectToNetworkadded inv1.10.0

func (daemon *Daemon) ConnectToNetwork(ctxcontext.Context, ctr *container.Container, idOrNamestring, endpointConfig *networktypes.EndpointSettings)error

ConnectToNetwork connects a container to a network

func (*Daemon)ContainerArchivePathadded inv1.8.0

func (daemon *Daemon) ContainerArchivePath(namestring, pathstring) (contentio.ReadCloser, stat *container.PathStat, _error)

ContainerArchivePath creates an archive of the filesystem resource at thespecified path in the container identified by the given name. Returns atar archive of the resource and whether it was a directory or a single file.

func (*Daemon)ContainerAttachadded inv1.2.0

func (daemon *Daemon) ContainerAttach(prefixOrNamestring, req *backend.ContainerAttachConfig)error

ContainerAttach attaches to logs according to the config passed in. See ContainerAttachConfig.

func (*Daemon)ContainerAttachRawadded inv1.11.0

func (daemon *Daemon) ContainerAttachRaw(prefixOrNamestring, stdinio.ReadCloser, stdout, stderrio.Writer, doStreambool, attached chan struct{})error

ContainerAttachRaw attaches the provided streams to the container's stdio

func (*Daemon)ContainerChangesadded inv1.2.0

func (daemon *Daemon) ContainerChanges(ctxcontext.Context, namestring) ([]archive.Change,error)

ContainerChanges returns a list of container fs changes

func (*Daemon)ContainerCreateadded inv1.2.0

ContainerCreate creates a regular container

func (*Daemon)ContainerCreateIgnoreImagesArgsEscaped

func (daemon *Daemon) ContainerCreateIgnoreImagesArgsEscaped(ctxcontext.Context, paramsbackend.ContainerCreateConfig) (containertypes.CreateResponse,error)

ContainerCreateIgnoreImagesArgsEscaped creates a regular container. This is called from the builder RUN caseand ensures that we do not take the images ArgsEscaped

func (*Daemon)ContainerCreateWorkdiradded inv1.13.0

func (daemon *Daemon) ContainerCreateWorkdir(cIDstring)error

ContainerCreateWorkdir creates the working directory. This solves theissue arising fromhttps://github.com/docker/docker/issues/27545,which was initially fixed byhttps://github.com/docker/docker/pull/27884. But that fixwas too expensive in terms of performance on Windows. Instead,https://github.com/docker/docker/pull/28514 introduces this new functionalitywhere the builder calls into the backend here to create the working directory.

func (*Daemon)ContainerExecCreateadded inv1.3.0

func (daemon *Daemon) ContainerExecCreate(namestring, options *containertypes.ExecOptions) (string,error)

ContainerExecCreate sets up an exec in a running container.

func (*Daemon)ContainerExecInspectadded inv1.4.0

func (daemon *Daemon) ContainerExecInspect(idstring) (*backend.ExecInspect,error)

ContainerExecInspect returns low-level information about the execcommand. An error is returned if the exec cannot be found.

func (*Daemon)ContainerExecResizeadded inv1.3.0

func (daemon *Daemon) ContainerExecResize(ctxcontext.Context, namestring, height, widthuint32)error

ContainerExecResize changes the size of the TTY of the processrunning in the exec with the given name to the given height andwidth.

func (*Daemon)ContainerExecStartadded inv1.3.0

func (daemon *Daemon) ContainerExecStart(ctxcontext.Context, namestring, optionsbackend.ExecStartConfig) (retErrerror)

ContainerExecStart starts a previously set up exec instance. Thestd streams are set up.If ctx is cancelled, the process is terminated.

func (*Daemon)ContainerExportadded inv1.2.0

func (daemon *Daemon) ContainerExport(ctxcontext.Context, namestring, outio.Writer)error

ContainerExport writes the contents of the container to the givenwriter. An error is returned if the container cannot be found.

func (*Daemon)ContainerExtractToDiradded inv1.8.0

func (daemon *Daemon) ContainerExtractToDir(name, pathstring, copyUIDGID, noOverwriteDirNonDirbool, contentio.Reader)error

ContainerExtractToDir extracts the given archive to the specified locationin the filesystem of the container identified by the given name. The givenpath must be of a directory in the container. If it is not, the error willbe an errdefs.InvalidParameter. If noOverwriteDirNonDir is true then it willbe an error if unpacking the given content would cause an existing directoryto be replaced with a non-directory and vice versa.

func (*Daemon)ContainerInspectadded inv0.12.0

func (daemon *Daemon) ContainerInspect(ctxcontext.Context, namestring, optionsbackend.ContainerInspectOptions) (*containertypes.InspectResponse,error)

ContainerInspect returns low-level information about acontainer. Returns an error if the container cannot be found, or ifthere is an error getting the data.

func (*Daemon)ContainerKilladded inv1.2.0

func (daemon *Daemon) ContainerKill(name, stopSignalstring)error

ContainerKill sends signal to the containerIf no signal is given, then Kill with SIGKILL and waitfor the container to exit.If a signal is given, then just send it to the container and return.

func (*Daemon)ContainerLogsadded inv1.2.0

func (daemon *Daemon) ContainerLogs(ctxcontext.Context, containerNamestring, config *containertypes.LogsOptions) (messages <-chan *backend.LogMessage, isTTYbool, retErrerror)

ContainerLogs copies the container's log channel to the channel provided inthe config. If ContainerLogs returns an error, no messages have been copied.and the channel will be closed without data.

if it returns nil, the config channel will be active and return logmessages until it runs out or the context is canceled.

func (*Daemon)ContainerPauseadded inv1.2.0

func (daemon *Daemon) ContainerPause(namestring)error

ContainerPause pauses a container

func (*Daemon)ContainerRenameadded inv1.5.0

func (daemon *Daemon) ContainerRename(oldName, newNamestring) (retErrerror)

ContainerRename changes the name of a container, using the oldNameto find the container. An error is returned if newName is alreadyreserved.

func (*Daemon)ContainerResizeadded inv1.2.0

func (daemon *Daemon) ContainerResize(ctxcontext.Context, namestring, height, widthuint32)error

ContainerResize changes the size of the TTY of the process runningin the container with the given name to the given height and width.

func (*Daemon)ContainerRestartadded inv1.2.0

func (daemon *Daemon) ContainerRestart(ctxcontext.Context, namestring, optionscontainertypes.StopOptions)error

ContainerRestart stops and starts a container. It attempts togracefully stop the container within the given timeout, forcefullystopping it if the timeout is exceeded. If given a negativetimeout, ContainerRestart will wait forever until a gracefulstop. Returns an error if the container cannot be found, or ifthere is an underlying error at any stage of the restart.

func (*Daemon)ContainerRmadded inv1.3.0

func (daemon *Daemon) ContainerRm(namestring, config *backend.ContainerRmConfig)error

ContainerRm removes the container id from the filesystem. An erroris returned if the container is not found, or if the removefails. If the remove succeeds, the container name is released, andnetwork links are removed.

func (*Daemon)ContainerStartadded inv1.2.0

func (daemon *Daemon) ContainerStart(ctxcontext.Context, namestring, checkpointstring, checkpointDirstring)error

ContainerStart starts a container.

func (*Daemon)ContainerStatPathadded inv1.8.0

func (daemon *Daemon) ContainerStatPath(namestring, pathstring) (*container.PathStat,error)

ContainerStatPath stats the filesystem resource at the specified path in thecontainer identified by the given name.

func (*Daemon)ContainerStatsadded inv1.5.0

func (daemon *Daemon) ContainerStats(ctxcontext.Context, prefixOrNamestring, config *backend.ContainerStatsConfig)error

ContainerStats writes information about the container to the streamgiven in the config object.

func (*Daemon)ContainerStopadded inv1.2.0

func (daemon *Daemon) ContainerStop(ctxcontext.Context, namestring, optionscontainertypes.StopOptions)error

ContainerStop looks for the given container and stops it.In case the container fails to stop gracefully within a time durationspecified by the timeout argument, in seconds, it is forcefullyterminated (killed).

If the timeout is nil, the container's StopTimeout value is used, if set,otherwise the engine default. A negative timeout value can be specified,meaning no timeout, i.e. no forceful termination is performed.

func (*Daemon)ContainerTopadded inv1.2.0

func (daemon *Daemon) ContainerTop(namestring, psArgsstring) (*container.TopResponse,error)

ContainerTop lists the processes running inside of the givencontainer by calling ps with the given args, or with the flags"-ef" if no args are given. An error is returned if the containeris not found, or is not running, or if there are any problemsrunning ps, or parsing the output.

func (*Daemon)ContainerUnpauseadded inv1.2.0

func (daemon *Daemon) ContainerUnpause(namestring)error

ContainerUnpause unpauses a container

func (*Daemon)ContainerUpdateadded inv1.10.0

func (daemon *Daemon) ContainerUpdate(namestring, hostConfig *container.HostConfig) (container.UpdateResponse,error)

ContainerUpdate updates configuration of the container

func (*Daemon)ContainerWaitadded inv1.2.0

func (daemon *Daemon) ContainerWait(ctxcontext.Context, namestring, conditioncontainertypes.WaitCondition) (<-chancontainertypes.StateStatus,error)

ContainerWait waits until the given container is in a certain stateindicated by the given condition. If the container is not found, a nilchannel and non-nil error is returned immediately. If the container isfound, a status result will be sent on the returned channel once the waitcondition is met or if an error occurs waiting for the container (such as acontext timeout or cancellation). On a successful wait, the exit code of thecontainer is returned in the status with a non-nil Err() value.

func (*Daemon)Containersadded inv1.2.0

func (daemon *Daemon) Containers(ctxcontext.Context, config *containertypes.ListOptions) ([]*containertypes.Summary,error)

Containers returns the list of containers to show given the user's filtering.

func (*Daemon)ContainersPruneadded inv1.13.0

func (daemon *Daemon) ContainersPrune(ctxcontext.Context, pruneFiltersfilters.Args) (*container.PruneReport,error)

ContainersPrune removes unused containers

func (*Daemon)CreateImageFromContainer

func (daemon *Daemon) CreateImageFromContainer(ctxcontext.Context, namestring, c *backend.CreateImageConfig) (string,error)

CreateImageFromContainer creates a new image from a container. The containerconfig will be updated by applying the change set to the custom config, thenapplying that config over the existing container config.

func (*Daemon)CreateManagedContaineradded inv1.12.0

func (daemon *Daemon) CreateManagedContainer(ctxcontext.Context, paramsbackend.ContainerCreateConfig) (containertypes.CreateResponse,error)

CreateManagedContainer creates a container that is managed by a Service

func (*Daemon)CreateManagedNetworkadded inv1.12.0

func (daemon *Daemon) CreateManagedNetwork(createclustertypes.NetworkCreateRequest)error

CreateManagedNetwork creates an agent network.

func (*Daemon)CreateNetworkadded inv1.9.0

CreateNetwork creates a network with the given name, driver and other optional parameters

func (*Daemon)DaemonJoinsClusteradded inv1.13.1

func (daemon *Daemon) DaemonJoinsCluster(clusterProvidercluster.Provider)

DaemonJoinsCluster informs the daemon has joined the cluster and providesthe handler to query the cluster component

func (*Daemon)DaemonLeavesClusteradded inv1.13.1

func (daemon *Daemon) DaemonLeavesCluster()

DaemonLeavesCluster informs the daemon has left the cluster

func (*Daemon)DeactivateContainerServiceBindingadded inv1.13.0

func (daemon *Daemon) DeactivateContainerServiceBinding(containerNamestring)error

DeactivateContainerServiceBinding removes this container from load balancer active rotation, and DNS response

func (*Daemon)DeleteManagedNetworkadded inv1.12.0

func (daemon *Daemon) DeleteManagedNetwork(networkIDstring)error

DeleteManagedNetwork deletes an agent network.The requirement of networkID is enforced.

func (*Daemon)DeleteNetworkadded inv1.10.0

func (daemon *Daemon) DeleteNetwork(networkIDstring)error

DeleteNetwork destroys a network unless it's one of docker's predefined networks.

func (*Daemon)DisconnectContainerFromNetworkadded inv1.10.0

func (daemon *Daemon) DisconnectContainerFromNetwork(containerNamestring, networkNamestring, forcebool)error

DisconnectContainerFromNetwork disconnects the given container fromthe given network. If either cannot be found, an err is returned.

func (*Daemon)DisconnectFromNetworkadded inv1.10.0

func (daemon *Daemon) DisconnectFromNetwork(ctxcontext.Context, ctr *container.Container, networkNamestring, forcebool)error

DisconnectFromNetwork disconnects container from network n.

func (*Daemon)DistributionServices

func (daemon *Daemon) DistributionServices()images.DistributionServices

DistributionServices returns services controlling daemon storage

func (*Daemon)ExecExistsadded inv1.9.0

func (daemon *Daemon) ExecExists(namestring) (bool,error)

ExecExists looks up the exec instance and returns a bool if it exists or not.It will also return the error produced by `getConfig`

func (*Daemon)Features

func (daemon *Daemon) Features() map[string]bool

Features returns the features map from configStore

func (*Daemon)FindNetworkadded inv1.9.0

func (daemon *Daemon) FindNetwork(termstring) (*libnetwork.Network,error)

FindNetwork returns a network based on:1. Full ID2. Full Name3. Partial IDas long as there is no ambiguity

func (*Daemon)ForceEndpointDeleteadded inv1.10.0

func (daemon *Daemon) ForceEndpointDelete(namestring, networkNamestring)error

ForceEndpointDelete deletes an endpoint from a network forcefully

func (*Daemon)GetAttachmentStore

func (daemon *Daemon) GetAttachmentStore() *network.AttachmentStore

GetAttachmentStore returns current attachment store associated with the daemon

func (*Daemon)GetByName

func (daemon *Daemon) GetByName(namestring) (*container.Container,error)

GetByName returns a container given a name.

func (*Daemon)GetClusteradded inv1.13.0

func (daemon *Daemon) GetCluster()Cluster

GetCluster returns the cluster

func (*Daemon)GetContaineradded inv1.10.0

func (daemon *Daemon) GetContainer(prefixOrNamestring) (*container.Container,error)

GetContainer looks for a container using the provided information, which could beone of the following inputs from the caller:

  • A full container ID, which will exact match a container in daemon's list
  • A container name, which will only exact match via the GetByName() function
  • A partial container ID prefix (e.g. short ID) of any length that isunique enough to only return a single container objectIf none of these searches succeed, an error is returned

func (*Daemon)GetContainerStatsadded inv1.10.0

func (daemon *Daemon) GetContainerStats(container *container.Container) (*containertypes.StatsResponse,error)

GetContainerStats collects all the stats published by a container

func (*Daemon)GetNetworkByIDadded inv1.11.0

func (daemon *Daemon) GetNetworkByID(idstring) (*libnetwork.Network,error)

GetNetworkByID function returns a network whose ID matches the given ID.It fails with an error if no matching network is found.

func (*Daemon)GetNetworkByNameadded inv1.11.0

func (daemon *Daemon) GetNetworkByName(namestring) (*libnetwork.Network,error)

GetNetworkByName function returns a network for a given network name.If no network name is given, the default network is returned.

func (*Daemon)GetNetworkDriverListadded inv1.10.0

func (daemon *Daemon) GetNetworkDriverList(ctxcontext.Context) []string

GetNetworkDriverList returns the list of plugins driversregistered for network.

func (*Daemon)GetNetworksadded inv1.12.0

func (daemon *Daemon) GetNetworks(filterfilters.Args, configbackend.NetworkListConfig) ([]networktypes.Inspect,error)

GetNetworks returns a list of all networks

func (*Daemon)GetNetworksByIDPrefix

func (daemon *Daemon) GetNetworksByIDPrefix(partialIDstring) []*libnetwork.Network

GetNetworksByIDPrefix returns a list of networks whose ID partially matches zero or more networks

func (*Daemon)HasExperimentaladded inv1.13.0

func (daemon *Daemon) HasExperimental()bool

HasExperimental returns whether the experimental features of the daemon are enabled or not

func (*Daemon)IDadded inv1.4.0

func (daemon *Daemon) ID()string

ID returns the daemon id

func (*Daemon)IdentityMapping

func (daemon *Daemon) IdentityMapping()user.IdentityMapping

IdentityMapping returns uid/gid mapping or a SID (in the case of Windows) for the builder

func (*Daemon)ImageBackend

func (daemon *Daemon) ImageBackend()executorpkg.ImageBackend

ImageBackend returns an image-backend for Swarm and the distribution router.

func (*Daemon)ImageExportedByBuildkit

func (daemon *Daemon) ImageExportedByBuildkit(ctxcontext.Context, idstring, descocispec.Descriptor)

ImageExportedByBuildkit is a callback that is called when an image is exported by buildkit.This is used to log the image creation event for untagged images.When no tag is given, buildkit doesn't call the image service so it has noway of knowing the image was created.

func (*Daemon)ImageNamedByBuildkit

func (daemon *Daemon) ImageNamedByBuildkit(ctxcontext.Context, refreference.NamedTagged, descocispec.Descriptor)

ImageNamedByBuildkit is a callback that is called when an image is tagged by buildkit.Note: It is only called if the buildkit didn't call the image service itself to perform the tagging.Currently this only happens when the containerd image store is used.

func (*Daemon)ImageService

func (daemon *Daemon) ImageService()ImageService

ImageService returns the Daemon's ImageService

func (*Daemon)IsShuttingDownadded inv1.10.0

func (daemon *Daemon) IsShuttingDown()bool

IsShuttingDown tells whether the daemon is shutting down or not

func (*Daemon)IsSwarmCompatibleadded inv1.12.0

func (daemon *Daemon) IsSwarmCompatible()error

IsSwarmCompatible verifies if the current daemonconfiguration is compatible with the swarm mode

func (*Daemon)Kill

func (daemon *Daemon) Kill(container *containerpkg.Container)error

Kill forcefully terminates a container.

func (*Daemon)List

func (daemon *Daemon) List() []*container.Container

List returns an array of all containers registered in the daemon.

func (*Daemon)LogContainerEventadded inv1.10.0

func (daemon *Daemon) LogContainerEvent(container *container.Container, actionevents.Action)

LogContainerEvent generates an event related to a container with only the default attributes.

func (*Daemon)LogContainerEventWithAttributesadded inv1.11.0

func (daemon *Daemon) LogContainerEventWithAttributes(container *container.Container, actionevents.Action, attributes map[string]string)

LogContainerEventWithAttributes generates an event related to a container with specific given attributes.

func (*Daemon)LogDaemonEventWithAttributesadded inv1.12.0

func (daemon *Daemon) LogDaemonEventWithAttributes(actionevents.Action, attributes map[string]string)

LogDaemonEventWithAttributes generates an event related to the daemon itself with specific given attributes.

func (*Daemon)LogNetworkEventadded inv1.10.0

func (daemon *Daemon) LogNetworkEvent(nw *libnetwork.Network, actionevents.Action)

LogNetworkEvent generates an event related to a network with only the default attributes.

func (*Daemon)LogNetworkEventWithAttributesadded inv1.10.0

func (daemon *Daemon) LogNetworkEventWithAttributes(nw *libnetwork.Network, actionevents.Action, attributes map[string]string)

LogNetworkEventWithAttributes generates an event related to a network with specific given attributes.

func (*Daemon)LogPluginEventadded inv1.12.1

func (daemon *Daemon) LogPluginEvent(pluginID, refNamestring, actionevents.Action)

LogPluginEvent generates an event related to a plugin with only the default attributes.

func (*Daemon)LogVolumeEventadded inv1.10.0

func (daemon *Daemon) LogVolumeEvent(volumeIDstring, actionevents.Action, attributes map[string]string)

LogVolumeEvent generates an event related to a volume.

func (*Daemon)Mount

func (daemon *Daemon) Mount(container *container.Container)error

Mount sets container.BaseFS

func (*Daemon)NetworkController

func (daemon *Daemon) NetworkController() *libnetwork.Controller

NetworkController returns the network controller created by the daemon.

func (*Daemon)NetworksPruneadded inv1.13.0

func (daemon *Daemon) NetworksPrune(ctxcontext.Context, pruneFiltersfilters.Args) (*network.PruneReport,error)

NetworksPrune removes unused networks

func (*Daemon)PluginGetteradded inv1.13.1

func (daemon *Daemon) PluginGetter() *plugin.Store

PluginGetter returns current pluginStore associated with the daemon

func (*Daemon)PluginManageradded inv1.13.0

func (daemon *Daemon) PluginManager() *plugin.Manager

PluginManager returns current pluginManager associated with the daemon

func (*Daemon)ProcessClusterNotifications

func (daemon *Daemon) ProcessClusterNotifications(ctxcontext.Context, watchStream chan *swarmapi.WatchMessage)

ProcessClusterNotifications gets changes from store and add them to event list

func (*Daemon)ProcessEvent

ProcessEvent is called by libcontainerd whenever an event occurs

func (*Daemon)RawSysInfo

func (daemon *Daemon) RawSysInfo() *sysinfo.SysInfo

RawSysInfo returns *sysinfo.SysInfo .

func (*Daemon)Registerdeprecated

func (daemon *Daemon) Register(c *container.Container)error

Register makes a container object usable by the daemon as <container.ID>

Deprecated: this function is unused and will be removed in the next release.

func (*Daemon)RegistryHosts

func (daemon *Daemon) RegistryHosts(hoststring) ([]docker.RegistryHost,error)

RegistryHosts returns the registry hosts configuration for the host componentof a distribution image reference.

func (*Daemon)RegistryServiceadded inv1.7.0

func (daemon *Daemon) RegistryService() *registry.Service

RegistryService returns the Daemon's RegistryService

func (*Daemon)ReleaseIngress

func (daemon *Daemon) ReleaseIngress() (<-chan struct{},error)

ReleaseIngress releases the ingress networking.The function returns a channel which will signal the caller when the programming is completed.

func (*Daemon)Reloadadded inv1.10.0

func (daemon *Daemon) Reload(conf *config.Config)error

Reload modifies the live daemon configuration from conf.conf is assumed to be a validated configuration.

These are the settings that Reload changes:- Platform runtime- Daemon debug log level- Daemon max concurrent downloads- Daemon max concurrent uploads- Daemon max download attempts- Daemon shutdown timeout (in seconds)- Cluster discovery (reconfigure and restart)- Daemon labels- Insecure registries- Registry mirrors- Daemon live restore

func (*Daemon)RestartSwarmContainersadded inv1.13.0

func (daemon *Daemon) RestartSwarmContainers()

RestartSwarmContainers restarts any autostart container which has aswarm endpoint.

func (*Daemon)SetClusteradded inv1.13.0

func (daemon *Daemon) SetCluster(clusterCluster)

SetCluster sets the cluster

func (*Daemon)SetContainerConfigReferences

func (daemon *Daemon) SetContainerConfigReferences(namestring, refs []*swarmtypes.ConfigReference)error

SetContainerConfigReferences sets the container config references needed

func (*Daemon)SetContainerDependencyStore

func (daemon *Daemon) SetContainerDependencyStore(namestring, storeexec.DependencyGetter)error

SetContainerDependencyStore sets the dependency store backend for the container

func (*Daemon)SetContainerSecretReferencesadded inv1.13.0

func (daemon *Daemon) SetContainerSecretReferences(namestring, refs []*swarmtypes.SecretReference)error

SetContainerSecretReferences sets the container secret references needed

func (*Daemon)SetNetworkBootstrapKeysadded inv1.12.0

func (daemon *Daemon) SetNetworkBootstrapKeys(keys []*lntypes.EncryptionKey)error

SetNetworkBootstrapKeys sets the bootstrap keys.

func (*Daemon)SetupIngressadded inv1.12.0

func (daemon *Daemon) SetupIngress(createclustertypes.NetworkCreateRequest, nodeIPstring) (<-chan struct{},error)

SetupIngress setups ingress networking.The function returns a channel which will signal the caller when the programming is completed.

func (*Daemon)Shutdownadded inv1.7.0

func (daemon *Daemon) Shutdown(ctxcontext.Context)error

Shutdown stops the daemon.

func (*Daemon)ShutdownTimeoutadded inv1.13.0

func (daemon *Daemon) ShutdownTimeout()int

ShutdownTimeout returns the timeout (in seconds) before containers are forciblykilled during shutdown. The default timeout can be configured both on the daemonand per container, and the longest timeout will be used. A grace-period of5 seconds is added to the configured timeout.

A negative (-1) timeout means "indefinitely", which means that containersare not forcibly killed, and the daemon shuts down after all containers exit.

func (*Daemon)StoreHosts

func (daemon *Daemon) StoreHosts(hosts []string)

StoreHosts stores the addresses the daemon is listening on

func (*Daemon)Subnets

func (daemon *Daemon) Subnets() ([]net.IPNet, []net.IPNet)

Subnets return the IPv4 and IPv6 subnets of networks that are manager by Docker.

func (*Daemon)SubscribeToEventsadded inv1.10.0

func (daemon *Daemon) SubscribeToEvents(since, untiltime.Time, filterfilters.Args) ([]events.Message, chan interface{})

SubscribeToEvents returns the currently record of events, a channel to stream new events from, and a function to cancel the stream of events.

func (*Daemon)SystemDiskUsageadded inv1.13.0

func (daemon *Daemon) SystemDiskUsage(ctxcontext.Context, optsbackend.DiskUsageOptions) (*backend.DiskUsage,error)

SystemDiskUsage returns information about the daemon data disk usage.Callers must not mutate contents of the returned fields.

func (*Daemon)SystemInfoadded inv1.7.0

func (daemon *Daemon) SystemInfo(ctxcontext.Context) (*system.Info,error)

SystemInfo returns information about the host server the daemon is running on.

The only error this should return is due to context cancellation/deadline.Anything else should be logged and ignored because this is looking upmultiple things and is often used for debugging.The only case valid early return is when the caller doesn't want the result anymore (ie context cancelled).

func (*Daemon)SystemVersionadded inv1.10.0

func (daemon *Daemon) SystemVersion(ctxcontext.Context) (types.Version,error)

SystemVersion returns version information about the daemon.

The only error this should return is due to context cancellation/deadline.Anything else should be logged and ignored because this is looking upmultiple things and is often used for debugging.The only case valid early return is when the caller doesn't want the result anymore (ie context cancelled).

func (*Daemon)Unmount

func (daemon *Daemon) Unmount(container *container.Container)error

Unmount unsets the container base filesystem

func (*Daemon)UnsubscribeFromEventsadded inv1.10.0

func (daemon *Daemon) UnsubscribeFromEvents(listener chan interface{})

UnsubscribeFromEvents stops the event subscription for a client by closing thechannel where the daemon sends events to.

func (*Daemon)UpdateAttachmentadded inv1.13.0

func (daemon *Daemon) UpdateAttachment(networkName, networkID, containerIDstring, config *networktypes.NetworkingConfig)error

UpdateAttachment notifies the attacher about the attachment config.

func (*Daemon)UpdateContainerServiceConfigadded inv1.12.0

func (daemon *Daemon) UpdateContainerServiceConfig(containerNamestring, serviceConfig *clustertypes.ServiceConfig)error

UpdateContainerServiceConfig updates a service configuration.

func (*Daemon)UsesSnapshotter

func (daemon *Daemon) UsesSnapshotter()bool

UsesSnapshotter returns true if feature flag to use containerd snapshotter is enabled

func (*Daemon)VolumesService

func (daemon *Daemon) VolumesService() *service.VolumesService

VolumesService is used to perform volume operations

func (*Daemon)WaitForDetachmentadded inv1.13.0

func (daemon *Daemon) WaitForDetachment(ctxcontext.Context, networkName, networkID, taskID, containerIDstring)error

WaitForDetachment makes the cluster manager wait for detachment ofthe container from the network.

typeImageService

type ImageService interface {PullImage(ctxcontext.Context, refreference.Named, platform *ocispec.Platform, metaHeaders map[string][]string, authConfig *registry.AuthConfig, outStreamio.Writer)errorPushImage(ctxcontext.Context, refreference.Named, platform *ocispec.Platform, metaHeaders map[string][]string, authConfig *registry.AuthConfig, outStreamio.Writer)errorCreateImage(ctxcontext.Context, config []byte, parentstring, contentStoreDigest digest.Digest) (builder.Image,error)ImageDelete(ctxcontext.Context, imageRefstring, optionsimagetype.RemoveOptions) ([]imagetype.DeleteResponse,error)ExportImage(ctxcontext.Context, names []string, platform *ocispec.Platform, outStreamio.Writer)errorLoadImage(ctxcontext.Context, inTario.ReadCloser, platform *ocispec.Platform, outStreamio.Writer, quietbool)errorImages(ctxcontext.Context, optsimagetype.ListOptions) ([]*imagetype.Summary,error)LogImageEvent(ctxcontext.Context, imageID, refNamestring, actionevents.Action)CountImages(ctxcontext.Context)intImagesPrune(ctxcontext.Context, pruneFiltersfilters.Args) (*imagetype.PruneReport,error)ImportImage(ctxcontext.Context, refreference.Named, platform *ocispec.Platform, msgstring, layerReaderio.Reader, changes []string) (image.ID,error)TagImage(ctxcontext.Context, imageIDimage.ID, newTagreference.Named)errorGetImage(ctxcontext.Context, refOrIDstring, optionsbackend.GetImageOpts) (*image.Image,error)ImageHistory(ctxcontext.Context, namestring, platform *ocispec.Platform) ([]*imagetype.HistoryResponseItem,error)CommitImage(ctxcontext.Context, cbackend.CommitConfig) (image.ID,error)SquashImage(id, parentstring) (string,error)ImageInspect(ctxcontext.Context, refOrIDstring, optsbackend.ImageInspectOpts) (*imagetype.InspectResponse,error)ImageDiskUsage(ctxcontext.Context) (int64,error)GetImageAndReleasableLayer(ctxcontext.Context, refOrIDstring, optsbackend.GetImageAndLayerOptions) (builder.Image,builder.ROLayer,error)CreateLayer(container *container.Container, initFunclayer.MountInit) (container.RWLayer,error)CreateLayerFromImage(img *image.Image, layerNamestring, rwLayerOpts *layer.CreateRWLayerOpts) (container.RWLayer,error)GetLayerByID(cidstring) (container.RWLayer,error)LayerStoreStatus() [][2]stringGetLayerMountID(cidstring) (string,error)ReleaseLayer(rwlayercontainer.RWLayer)errorGetContainerLayerSize(ctxcontext.Context, containerIDstring) (int64,int64,error)Changes(ctxcontext.Context, container *container.Container) ([]archive.Change,error)GetLayerFolders(img *image.Image, rwLayercontainer.RWLayer, containerIDstring) ([]string,error)MakeImageCache(ctxcontext.Context, cacheFrom []string) (builder.ImageCache,error)CommitBuildStep(ctxcontext.Context, cbackend.CommitConfig) (image.ID,error)DistributionServices()images.DistributionServicesChildren(ctxcontext.Context, idimage.ID) ([]image.ID,error)Cleanup()errorStorageDriver()stringUpdateConfig(maxDownloads, maxUploadsint)}

ImageService is a temporary interface to assist in the migration to thecontainerd image-store. This interface should not be considered stable,and may change over time.

typeNetworkManager

type NetworkManager interface {GetNetwork(inputstring) (network.Inspect,error)GetNetworks(filters.Args) ([]network.Inspect,error)RemoveNetwork(inputstring)error}

NetworkManager provides methods to manage networks

typePredefinedNetworkError

type PredefinedNetworkErrorstring

PredefinedNetworkError is returned when user tries to create predefined network that already exists.

func (PredefinedNetworkError)Error

func (PredefinedNetworkError)Forbidden

func (pnrPredefinedNetworkError) Forbidden()

Forbidden denotes the type of this error

Source Files

View all Source files

Directories

PathSynopsis
internal
capabilities
Package capabilities allows to generically handle capabilities.
Package capabilities allows to generically handle capabilities.
Package logger defines interfaces that logger drivers implement to log messages.
Package logger defines interfaces that logger drivers implement to log messages.
awslogs
Package awslogs provides the logdriver for forwarding container logs to Amazon CloudWatch Logs
Package awslogs provides the logdriver for forwarding container logs to Amazon CloudWatch Logs
etwlogs
Package etwlogs provides a log driver for forwarding container logs as ETW events.(ETW stands for Event Tracing for Windows) A client can then create an ETW listener to listen for events that are sent by the ETW provider that we register, using the provider's GUID "a3693192-9ed6-46d2-a981-f8226c8363bd".
Package etwlogs provides a log driver for forwarding container logs as ETW events.(ETW stands for Event Tracing for Windows) A client can then create an ETW listener to listen for events that are sent by the ETW provider that we register, using the provider's GUID "a3693192-9ed6-46d2-a981-f8226c8363bd".
fluentd
Package fluentd provides the log driver for forwarding server logs to fluentd endpoints.
Package fluentd provides the log driver for forwarding server logs to fluentd endpoints.
gelf
Package gelf provides the log driver for forwarding server logs to endpoints that support the Graylog Extended Log Format.
Package gelf provides the log driver for forwarding server logs to endpoints that support the Graylog Extended Log Format.
journald
Package journald provides the log driver for forwarding server logs to endpoints that receive the systemd format.
Package journald provides the log driver for forwarding server logs to endpoints that receive the systemd format.
journald/internal/export
Package export implements a serializer for the systemd Journal Export Format as documented at https://systemd.io/JOURNAL_EXPORT_FORMATS/
Package export implements a serializer for the systemd Journal Export Format as documented at https://systemd.io/JOURNAL_EXPORT_FORMATS/
journald/internal/fake
Package fake implements a journal writer for testing which is decoupled from the system's journald.
Package fake implements a journal writer for testing which is decoupled from the system's journald.
journald/internal/sdjournal
Package sdjournal provides a Go interface to the systemd journal read API by wrapping the libsystemd C library.
Package sdjournal provides a Go interface to the systemd journal read API by wrapping the libsystemd C library.
jsonfilelog
Package jsonfilelog provides the default Logger implementation for Docker logging.
Package jsonfilelog provides the default Logger implementation for Docker logging.
local
Package local provides a logger implementation that stores logs on disk.
Package local provides a logger implementation that stores logs on disk.
splunk
Package splunk provides the log driver for forwarding server logs to Splunk HTTP Event Collector endpoint.
Package splunk provides the log driver for forwarding server logs to Splunk HTTP Event Collector endpoint.
syslog
Package syslog provides the logdriver for forwarding server logs to syslog endpoints.
Package syslog provides the logdriver for forwarding server logs to syslog endpoints.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp