A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pkg.go.dev/github.com/moby/moby/v2/daemon@v2.0.0-20250814210528-a34c4d9bb99f below:

daemon package - github.com/moby/moby/v2/daemon - Go Packages

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

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

This section is empty.

This section is empty.

CreateDaemonRoot creates the root for the daemon

func DefaultApparmorProfile() string

DefaultApparmorProfile returns the name of the default apparmor profile

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

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

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.

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 enabled Then it will return new namespace names, otherwise it will return the existing namespaces

Rootless returns true if daemon is running in rootless mode

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

WithApparmor sets the apparmor profile

WithCapabilities adjusts the container's capabilities based on the "CapAdd", "CapDrop", and "Privileged" fields in the container's HostConfig.

WithConsoleSize sets the initial console size

WithDevices sets the container's devices

WithNamespaces sets the container's namespaces

WithOOMScore sets the oom score

WithResources applies the container resources

WithSeccomp sets the seccomp profile

WithSelinux sets the selinux labels

WithSysctls sets the container's sysctls

WithUser sets the container's user

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

ClusterStatus interface provides information about the Swarm status of the Cluster

Daemon holds information about the Docker daemon.

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

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

AuthenticateToRegistry checks the validity of credentials in authConfig

BuilderBackend returns the backend used by builder

CheckpointCreate checkpoints the process running in a container with CRIU

CheckpointDelete deletes the specified checkpoint

CheckpointList lists all checkpoints of the specified container

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

Config returns daemon's config.

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

ConnectToNetwork connects a container to a network

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

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

ContainerAttachRaw attaches the provided streams to the container's stdio

ContainerChanges returns a list of container fs changes

ContainerCreate creates a regular container

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

ContainerExecCreate sets up an exec in a running container.

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

ContainerExecResize changes the size of the TTY of the process running in the exec with the given name to the given height and width.

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

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

ContainerExtractToDir extracts the given archive to the specified location in the filesystem of the container identified by the given name. The given path must be of a directory in the container. If it is not, the error will be an errdefs.InvalidParameter. It returns an error if unpacking the given content would cause an existing directory to be replaced with a non-directory or vice versa, unless allowOverwriteDirWithFile is set to true.

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

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

ContainerLogs copies the container's log channel to the channel provided in the 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 log messages until it runs out or the context is canceled.

ContainerPause pauses a container

ContainerRename changes the name of a container, using the oldName to find the container. An error is returned if newName is already reserved.

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

ContainerRestart stops and starts a container. It attempts to gracefully stop the container within the given timeout, forcefully stopping it if the timeout is exceeded. If given a negative timeout, ContainerRestart will wait forever until a graceful stop. Returns an error if the container cannot be found, or if there is an underlying error at any stage of the restart.

ContainerRm removes the container id from the filesystem. An error is returned if the container is not found, or if the remove fails. If the remove succeeds, the container name is released, and network links are removed.

ContainerStart starts a container.

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

ContainerStats writes information about the container to the stream given in the config object.

ContainerStop looks for the given container and stops it. In case the container fails to stop gracefully within a time duration specified by the timeout argument, in seconds, it is forcefully terminated (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.

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

ContainerUnpause unpauses a container

ContainerUpdate updates configuration of the container

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

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

ContainersPrune removes unused containers

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

CreateManagedContainer creates a container that is managed by a Service

CreateManagedNetwork creates an agent network.

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

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

func (daemon *Daemon) DaemonLeavesCluster()

DaemonLeavesCluster informs the daemon has left the cluster

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

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

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

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

DisconnectFromNetwork disconnects container from network n.

DistributionServices returns services controlling daemon storage

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

Features returns the features map from configStore

FindNetwork returns a network based on: 1. Full ID 2. Full Name 3. Partial ID as long as there is no ambiguity

ForceEndpointDelete deletes an endpoint from a network forcefully

GetAttachmentStore returns current attachment store associated with the daemon

GetByName returns a container given a name.

GetCluster returns the cluster

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

GetContainerStats collects all the stats published by a container

GetDependentContainers returns a list of containers that depend on the given container. Dependencies are determined by:

This is primarily used during daemon startup to determine container startup order, ensuring that dependent containers are started after their dependencies are running. Upon error, it returns the last known dependent containers, which may be empty.

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

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

GetNetworkDriverList returns the list of plugins drivers registered for network.

GetNetworks returns a list of all networks

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

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

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

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

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 no way of knowing the image was created.

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.

ImageService returns the Daemon's ImageService

IsShuttingDown tells whether the daemon is shutting down or not

IsSwarmCompatible verifies if the current daemon configuration is compatible with the swarm mode

Kill forcefully terminates a container.

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

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

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

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

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

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

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

LogVolumeEvent generates an event related to a volume.

Mount sets container.BaseFS

NetworkController returns the network controller created by the daemon.

NetworksPrune removes unused networks

PluginGetter returns current pluginStore associated with the daemon

PluginManager returns current pluginManager associated with the daemon

ProcessClusterNotifications gets changes from store and add them to event list

ProcessEvent is called by libcontainerd whenever an event occurs

RawSysInfo returns *sysinfo.SysInfo .

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.

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

RegistryService returns the Daemon's RegistryService

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.

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 *Daemon) RestartSwarmContainers()

RestartSwarmContainers restarts any autostart container which has a swarm endpoint.

SetCluster sets the cluster

SetContainerConfigReferences sets the container config references needed

SetContainerDependencyStore sets the dependency store backend for the container

SetContainerSecretReferences sets the container secret references needed

SetNetworkBootstrapKeys sets the bootstrap keys.

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

Shutdown stops the daemon.

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

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

StoreHosts stores the addresses the daemon is listening on

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

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

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

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 up multiple 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).

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 up multiple 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).

Unmount unsets the container base filesystem

func (daemon *Daemon) UnsubscribeFromEvents(listener chan any)

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

UpdateAttachment notifies the attacher about the attachment config.

UpdateContainerServiceConfig updates a service configuration.

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

VolumesService is used to perform volume operations

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

type ImageService interface {
	PullImage(ctx context.Context, ref reference.Named, platform *ocispec.Platform, metaHeaders map[string][]string, authConfig *registry.AuthConfig, outStream io.Writer) error
	PushImage(ctx context.Context, ref reference.Named, platform *ocispec.Platform, metaHeaders map[string][]string, authConfig *registry.AuthConfig, outStream io.Writer) error
	CreateImage(ctx context.Context, config []byte, parent string, contentStoreDigest digest.Digest) (builder.Image, error)
	ImageDelete(ctx context.Context, imageRef string, options imagetype.RemoveOptions) ([]imagetype.DeleteResponse, error)
	ExportImage(ctx context.Context, names []string, platformList []ocispec.Platform, outStream io.Writer) error
	LoadImage(ctx context.Context, inTar io.ReadCloser, platformList []ocispec.Platform, outStream io.Writer, quiet bool) error
	Images(ctx context.Context, opts imagetype.ListOptions) ([]*imagetype.Summary, error)
	LogImageEvent(ctx context.Context, imageID, refName string, action events.Action)
	CountImages(ctx context.Context) int
	ImagesPrune(ctx context.Context, pruneFilters filters.Args) (*imagetype.PruneReport, error)
	ImportImage(ctx context.Context, ref reference.Named, platform *ocispec.Platform, msg string, layerReader io.Reader, changes []string) (image.ID, error)
	TagImage(ctx context.Context, imageID image.ID, newTag reference.Named) error
	GetImage(ctx context.Context, refOrID string, options backend.GetImageOpts) (*image.Image, error)
	ImageHistory(ctx context.Context, name string, platform *ocispec.Platform) ([]*imagetype.HistoryResponseItem, error)
	CommitImage(ctx context.Context, c backend.CommitConfig) (image.ID, error)
	SquashImage(id, parent string) (string, error)
	ImageInspect(ctx context.Context, refOrID string, opts backend.ImageInspectOpts) (*imagetype.InspectResponse, error)
	ImageDiskUsage(ctx context.Context) (int64, error)

	GetImageAndReleasableLayer(ctx context.Context, refOrID string, opts backend.GetImageAndLayerOptions) (builder.Image, builder.ROLayer, error)
	CreateLayer(container *container.Container, initFunc layer.MountInit) (container.RWLayer, error)
	CreateLayerFromImage(img *image.Image, layerName string, rwLayerOpts *layer.CreateRWLayerOpts) (container.RWLayer, error)
	GetLayerByID(cid string) (container.RWLayer, error)
	LayerStoreStatus() [][2]string
	GetLayerMountID(cid string) (string, error)
	ReleaseLayer(rwlayer container.RWLayer) error
	GetContainerLayerSize(ctx context.Context, containerID string) (int64, int64, error)
	Changes(ctx context.Context, container *container.Container) ([]archive.Change, error)

	GetLayerFolders(img *image.Image, rwLayer container.RWLayer, containerID string) ([]string, error)

	MakeImageCache(ctx context.Context, cacheFrom []string) (builder.ImageCache, error)
	CommitBuildStep(ctx context.Context, c backend.CommitConfig) (image.ID, error)

	DistributionServices() images.DistributionServices
	Children(ctx context.Context, id image.ID) ([]image.ID, error)
	Cleanup() error
	StorageDriver() string
	UpdateConfig(maxDownloads, maxUploads int)
}

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

NetworkManager provides methods to manage networks

type PredefinedNetworkError string

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

Forbidden denotes the type of this error


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4