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@v2.0.0-20250814210528-a34c4d9bb99f/daemon/container below:

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

This section is empty.

This section is empty.

func ReplaceOrAppendEnvValues(defaults, overrides []string) []string

ReplaceOrAppendEnvValues returns the defaults with the overrides either replaced by env key or appended to the list

Container holds the structure defining a container object.

NewBaseContainer creates a new container with its basic configuration.

AddMountPointWithVolume adds a new mount point configured with a volume to the container.

AttachContext returns the context for attach calls to track container liveness.

BuildHostnameFile writes the container's hostname file.

func (container *Container) CancelAttachContext()

CancelAttachContext cancels attach context. All attach calls should detach after this call.

CheckpointDir returns the directory checkpoints are stored in

CheckpointTo makes the Container's current state visible to queries, and persists state. Callers must hold a Container lock.

CloseStreams closes the container's stdio streams

CommitInMemory makes the Container's current state visible to queries, but does not persist state.

Callers must hold a Container lock.

ConfigFilePath returns the path to the on-disk location of a config. On unix, configs are always considered secret

ConfigPath returns the path to the container's JSON config

CopyImagePathContent copies files in destination to the volume.

CreateDaemonEnvironment creates a new environment variable slice for this container.

func (*Container) DetachAndUnmount

DetachAndUnmount uses a detached mount on all mount destinations, then unmounts each volume normally. This is used from daemon/archive for `docker cp`

ExitOnNext signals to the monitor that it should not restart the container after we send the kill signal.

FromDisk loads the container configuration stored in the host.

FullHostname returns hostname and optional domain appended to it.

GetExecIDs returns the list of exec commands running on the container.

GetMountLabel returns the mounting label for the container. This label is empty if the container is privileged.

GetMountPoints gives a platform specific transformation to types.MountPoint. Callers must hold a Container lock.

GetProcessLabel returns the process label for the container.

GetResourcePath evaluates `path` in the scope of the container's BaseFS, with proper path sanitization. Symlinks are all scoped to the BaseFS of the container, as though the container's BaseFS was `/`.

The BaseFS of a container is the host-facing path which is bind-mounted as `/` inside the container. This method is essentially used to access a particular path inside the container as though you were a process in that container.

# NOTE The returned path is *only* safely scoped inside the container's BaseFS if no component of the returned path changes (such as a component symlinking to a different path) between using this method and using the path. See symlink.FollowSymlinkInScope for more details.

GetRootResourcePath evaluates `path` in the scope of the container's root, with proper path sanitization. Symlinks are all scoped to the root of the container, as though the container's root was `/`.

The root of a container is the host-facing configuration metadata directory. Only use this method to safely access the container's `container.json` or other metadata files. If in doubt, use container.GetResourcePath.

# NOTE The returned path is *only* safely scoped inside the container's root if no component of the returned path changes (such as a component symlinking to a different path) between using this method and using the path. See symlink.FollowSymlinkInScope for more details.

GetRunningTask asserts that the container is running and returns the Task for the container. An errdefs.Conflict error is returned if the container is not in the Running state.

A system error is returned if container is in a bad state: Running is true but has a nil Task.

The container lock must be held when calling this method.

HasMountFor checks if path is a mountpoint

HostConfigPath returns the path to the container's JSON hostconfig

func (container *Container) InitDNSHostConfig()

InitDNSHostConfig ensures that the dns fields are never nil. New containers don't ever have those fields nil, but pre created containers can still have those nil values. The non-recommended host configuration in the start api can make these fields nil again, this corrects that issue until we remove that behavior for good. See https://github.com/moby/moby/pull/17779 for a more detailed explanation on why we don't want that.

InitializeStdio is called by libcontainerd to connect the stdio.

IpcMounts returns the list of IPC mounts

IsDestinationMounted checks whether a path is mounted on the container or not.

MountsResourcePath returns the path where mounts are stored for the given mount

NetworkMounts returns the list of network mounts.

Reset puts a container into a state where it can be restarted again.

ResetRestartManager initializes new restartmanager based on container config

RestartManager returns the current restartmanager instance connected to container.

RestoreTask restores the containerd container and task handles and reattaches the IO for the running task. Container state is not synced with containerd's state.

An errdefs.NotFound error is returned if the container does not exist in containerd. However, a nil error is returned if the task does not exist in containerd.

SecretFilePath returns the path to the location of a secret on the host.

SecretMountPath returns the path of the secret mount for the container

SecretMounts returns the mounts for the secret path.

SetupWorkingDirectory sets up the container's working directory as set in container.Config.WorkingDir

ShmResourcePath returns path to shm

ShouldRestart decides whether the daemon should restart the container or not. This is based on the container's restart policy.

StartLogger starts a new logger driver for the container.

StderrPipe gets the stderr stream of the container

StdinPipe gets the stdin stream of the container

StdoutPipe gets the stdout stream of the container

StopSignal returns the signal used to stop the container.

StopTimeout returns the timeout (in seconds) used to stop the container.

TmpfsMounts returns the list of tmpfs mounts

TrySetNetworkMount attempts to set the network mounts given a provided destination and the path to use for it; return true if the given destination was a network mount file

UnmountIpcMount unmounts shm if it was mounted

UnmountSecrets unmounts the local tmpfs for secrets

UnmountVolumes unmounts all volumes

UpdateContainer updates configuration of a container. Callers must hold a Lock on the Container.

UpdateMonitor updates monitor configure for running container

WriteHostConfig saves the host configuration on disk for the container, and returns a deep copy of the saved object. Callers must hold a Container lock.

ExecConfig holds the configurations for execs. The Daemon keeps track of both running and finished execs so that they can be examined both during and after completion.

NewExecConfig initializes the a new exec configuration

CloseStreams closes the stdio streams for the exec

InitializeStdio is called by libcontainerd to connect the stdio.

SetExitCode sets the exec config's exit code

type ExecStore struct {
	
}

ExecStore keeps track of the exec configurations.

NewExecStore initializes a new exec store.

Add adds a new exec configuration to the store.

func (*ExecStore) Commands

Commands returns the exec configurations in the store.

Delete removes an exec configuration from the store.

Get returns an exec configuration by its id.

List returns the list of exec ids in the store.

type ExitStatus struct {
	
	ExitCode int

	
	ExitedAt time.Time
}

ExitStatus provides exit reasons for a container.

Health holds the current container health-check state

func (s *Health) CloseMonitorChannel()

CloseMonitorChannel closes any existing monitor channel.

func (s *Health) OpenMonitorChannel() chan struct{}

OpenMonitorChannel creates and returns a new monitor channel. If there already is one, it returns nil.

SetStatus writes the current status to the underlying health structure, obeying the locking semantics.

Status may be set directly if another lock is used.

Status returns the current health status.

Note that this takes a lock and the value may change after being read.

String returns a human-readable description of the health-check state

History is a convenience type for storing a list of containers, sorted by creation date in descendant order.

Len returns the number of containers in the history.

Less compares two containers and returns true if the second one was created before the first one.

Swap switches containers i and j positions in the history.

type Mount struct {
	Source                 string `json:"source"`
	Destination            string `json:"destination"`
	Writable               bool   `json:"writable"`
	Data                   string `json:"data"`
	Propagation            string `json:"mountpropagation"`
	NonRecursive           bool   `json:"nonrecursive"`
	ReadOnlyNonRecursive   bool   `json:"readonlynonrecursive"`
	ReadOnlyForceRecursive bool   `json:"readonlyforcerecursive"`
}

Mount contains information for a mount operation.

RWLayer represents a writable layer for a container.

Snapshot is a read only view for Containers. It holds all information necessary to serve container queries in a versioned ACID in-memory store.

State holds the current container state, and has methods to get and set the state. State is embedded in the Container struct.

State contains an exported sync.Mutex which is used as a global lock for both the State and the Container it's embedded in.

NewState creates a default state object.

C8dContainer returns a reference to the libcontainerd Container object for the container and whether the reference is valid.

The container lock must be held when calling this method.

Err returns an error if there is one.

ExitCode returns current exitcode for the state. Take lock before if state may be shared.

GetPID holds the process id of a container.

IsDead returns whether the Dead flag is set. Used by Container to check whether a container is dead.

IsPaused returns whether the container is paused.

Note that [State.Running], [State.Restarting], and [State.Paused] are not mutually exclusive.

When pausing a container (on Linux), the freezer cgroup is used to suspend all processes in the container. Freezing the process requires the process to be running. As a result, paused containers can have both [State.Running] and [State.Paused] set to true.

In a similar fashion, [State.Running] and [State.Restarting] can both be true in a situation where a container is in process of being restarted. Refer to State.StateString for order of precedence.

IsRemovalInProgress returns whether the RemovalInProgress flag is set. Used by Container to check whether a container is being removed.

IsRestarting returns whether the container is restarting.

Note that [State.Running], [State.Restarting], and [State.Paused] are not mutually exclusive.

When pausing a container (on Linux), the freezer cgroup is used to suspend all processes in the container. Freezing the process requires the process to be running. As a result, paused containers can have both [State.Running] and [State.Paused] set to true.

In a similar fashion, [State.Running] and [State.Restarting] can both be true in a situation where a container is in process of being restarted. Refer to State.StateString for order of precedence.

IsRunning returns whether the [State.Running] flag is set.

Note that [State.Running], [State.Restarting], and [State.Paused] are not mutually exclusive.

When pausing a container (on Linux), the freezer cgroup is used to suspend all processes in the container. Freezing the process requires the process to be running. As a result, paused containers can have both [State.Running] and [State.Paused] set to true.

In a similar fashion, [State.Running] and [State.Restarting] can both be true in a situation where a container is in process of being restarted. Refer to State.StateString for order of precedence.

func (s *State) ResetRemovalInProgress()

ResetRemovalInProgress makes the RemovalInProgress state to false.

SetError sets the container's error state. This is useful when we want to know the error that occurred when container transits to another state when inspecting it

SetExitCode sets current exitcode for the state. Take lock before if state may be shared.

SetRemovalError is to be called in case a container remove failed. It sets an error and notifies all waiters.

SetRemovalInProgress sets the container state as being removed. It returns true if the container was already in that state.

func (s *State) SetRemoved()

SetRemoved assumes this container is already in the "dead" state and notifies all waiters.

SetRestarting sets the container state to "restarting" without locking. It also sets the container PID to 0.

SetRunning sets the running state along with StartedAt time.

SetRunningExternal sets the running state without setting the `StartedAt` time (used for containers not started by Docker instead of SetRunning).

SetStopped sets the container state to "stopped" without locking.

StateString returns the container's current [ContainerState], based on the [State.Running], [State.Paused], [State.Restarting], [State.RemovalInProgress], [State.StartedAt] and [State.Dead] fields.

String returns a human-readable description of the state

Task returns a reference to the libcontainerd Task object for the container and whether the reference is valid.

The container lock must be held when calling this method.

See also: (*Container).GetRunningTask().

Wait waits until the container is in a certain state indicated by the given condition. A context must be used for cancelling the request, controlling timeouts, and avoiding goroutine leaks. Wait must be called without holding the state lock. Returns a channel from which the caller will receive the result. If the container exited on its own, the result's Err() method will be nil and its ExitCode() method will return the container's exit code, otherwise, the results Err() method will return an error indicating why the wait operation failed.

type StateStatus struct {
	
}

StateStatus is used to return container wait results. Implements exec.ExitCode interface. This type is needed as State include a sync.Mutex field which make copying it unsafe.

Err returns current error for the state. Returns nil if the container had exited on its own.

ExitCode returns current exitcode for the state.

Store defines an interface that any container store must implement.

func NewMemoryStore() Store

NewMemoryStore initializes a new memory store.

StoreFilter defines a function to filter container in the store.

StoreReducer defines a function to manipulate containers in the store

View provides a consistent read-only view of the database.

All returns a all items in this snapshot. Returned objects must never be modified.

Get returns an item by id. Returned objects must never be modified. It returns an errdefs.NotFound if the given id was not found.

GetAllNames returns all registered names.

GetID returns the container ID that the passed in name is reserved to. It returns an errdefs.NotFound if the given id was not found.

ViewDB provides an in-memory transactional (ACID) container store.

NewViewDB provides the default implementation, with the default schema

Delete removes an item by ID

GetByPrefix returns a container with the given ID prefix. It returns an error if an empty prefix was given or if multiple containers match the prefix. It returns an errdefs.NotFound if the given s yielded no results.

ReleaseName releases the reserved name Once released, a name can be reserved again

ReserveName registers a container ID to a name. ReserveName is idempotent, but returns an errdefs.Conflict when attempting to reserve a container ID to a name that already is reserved.

Save atomically updates the in-memory store state for a Container. Only read only (deep) copies of containers may be passed in.

Snapshot provides a consistent read-only view of the database.


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