container

package
v2.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionResult

type ActionResult struct {
	// Started is a list of container IDs that were started.
	//
	// Required: false
	Started []string `json:"started,omitempty"`

	// Stopped is a list of container IDs that were stopped.
	//
	// Required: false
	Stopped []string `json:"stopped,omitempty"`

	// Failed is a list of container IDs that failed.
	//
	// Required: false
	Failed []string `json:"failed,omitempty"`

	// Success indicates if the overall action was successful.
	//
	// Required: true
	Success bool `json:"success"`

	// Errors is a list of error messages encountered.
	//
	// Required: false
	Errors []string `json:"errors,omitempty"`

	// ActivityID is the background activity that tracked this action.
	//
	// Required: false
	ActivityID *string `json:"activityId,omitempty"`
}

ActionResult represents the result of a container action (start/stop/etc).

type CommitRequest added in v2.2.0

type CommitRequest struct {
	// Repository is the target image repository.
	//
	// Required: false
	Repository string `json:"repository,omitempty" doc:"Target image repository"`

	// Tag is the target image tag.
	//
	// Required: false
	Tag string `json:"tag,omitempty" doc:"Target image tag"`

	// Comment records why the image was committed.
	//
	// Required: false
	Comment string `json:"comment,omitempty" doc:"Commit comment"`

	// Author records who created the committed image.
	//
	// Required: false
	Author string `json:"author,omitempty" doc:"Commit author"`

	// Changes contains Dockerfile-style changes to apply during commit.
	//
	// Required: false
	Changes []string `json:"changes,omitempty" doc:"Dockerfile changes to apply"`

	// NoPause disables the default pause during commit.
	//
	// Required: false
	NoPause bool `json:"noPause,omitempty" doc:"Do not pause the container during commit"`
}

CommitRequest is used to create an image from a container's current filesystem.

type CommitResult added in v2.2.0

type CommitResult struct {
	ID string `json:"id"`
}

CommitResult identifies the image created by a container commit.

type ComposeInfo

type ComposeInfo struct {
	// ProjectName is the name of the Docker Compose project.
	//
	// Required: true
	ProjectName string `json:"projectName"`

	// ServiceName is the name of the service within the Compose project.
	//
	// Required: true
	ServiceName string `json:"serviceName"`

	// WorkingDir is the working directory of the Compose project.
	//
	// Required: false
	WorkingDir string `json:"workingDir,omitempty"`

	// ConfigFiles is the list of Compose config file paths for the project.
	//
	// Required: false
	ConfigFiles string `json:"configFiles,omitempty"`
}

ComposeInfo contains Docker Compose project information extracted from container labels.

type Config

type Config struct {
	// Env is a list of environment variables.
	//
	// Required: false
	Env []string `json:"env,omitempty"`

	// Cmd is the command to run.
	//
	// Required: false
	Cmd []string `json:"cmd,omitempty"`

	// Entrypoint is the entrypoint for the container.
	//
	// Required: false
	Entrypoint []string `json:"entrypoint,omitempty"`

	// WorkingDir is the working directory.
	//
	// Required: false
	WorkingDir string `json:"workingDir,omitempty"`

	// User to run as.
	//
	// Required: false
	User string `json:"user,omitempty"`

	// Healthcheck is the container's healthcheck configuration.
	//
	// Required: false
	Healthcheck *Healthcheck `json:"healthcheck,omitempty"`
}

Config represents configuration details for a container.

type Create

type Create struct {
	// Name of the container.
	//
	// Required: true
	Name string `json:"name" binding:"required"`

	// Image to use for the container.
	//
	// Required: true
	Image string `json:"image" binding:"required"`

	// Command to run in the container.
	//
	// Required: false
	Command []string `json:"command,omitempty"`

	// Cmd is an alias for Command.
	//
	// Required: false
	Cmd []string `json:"cmd,omitempty"`

	// Entrypoint for the container.
	//
	// Required: false
	Entrypoint []string `json:"entrypoint,omitempty"`

	// WorkingDir is the working directory inside the container.
	//
	// Required: false
	WorkingDir string `json:"workingDir,omitempty"`

	// User to run the container as.
	//
	// Required: false
	User string `json:"user,omitempty"`

	// Environment variables for the container.
	//
	// Required: false
	Environment []string `json:"environment,omitempty"`

	// Env is an alias for Environment.
	//
	// Required: false
	Env []string `json:"env,omitempty"`

	// Labels to set on the container.
	//
	// Required: false
	Labels map[string]string `json:"labels,omitempty"`

	// ExposedPorts are ports exposed by the container.
	//
	// Required: false
	ExposedPorts map[string]struct{} `json:"exposedPorts,omitempty"`

	// Healthcheck overrides the image healthcheck. Test ["NONE"] disables it.
	//
	// Required: false
	Healthcheck *HealthcheckCreate `json:"healthcheck,omitempty"`

	// HostConfig holds advanced host-level settings.
	//
	// Required: false
	HostConfig *HostConfigCreate `json:"hostConfig,omitempty"`

	// NetworkingConfig defines network endpoints.
	//
	// Required: false
	NetworkingConfig *NetworkingConfigCreate `json:"networkingConfig,omitempty"`

	// Hostname for the container.
	//
	// Required: false
	Hostname string `json:"hostname,omitempty"`

	// Domainname for the container.
	//
	// Required: false
	Domainname string `json:"domainname,omitempty"`

	// AttachStdout attaches stdout.
	//
	// Required: false
	AttachStdout bool `json:"attachStdout,omitempty"`

	// AttachStderr attaches stderr.
	//
	// Required: false
	AttachStderr bool `json:"attachStderr,omitempty"`

	// AttachStdin attaches stdin.
	//
	// Required: false
	AttachStdin bool `json:"attachStdin,omitempty"`

	// Tty allocates a pseudo-TTY.
	//
	// Required: false
	Tty bool `json:"tty,omitempty"`

	// OpenStdin keeps stdin open.
	//
	// Required: false
	OpenStdin bool `json:"openStdin,omitempty"`

	// StdinOnce closes stdin after first attach.
	//
	// Required: false
	StdinOnce bool `json:"stdinOnce,omitempty"`

	// NetworkDisabled disables networking.
	//
	// Required: false
	NetworkDisabled bool `json:"networkDisabled,omitempty"`

	// Ports is a map of port bindings.
	//
	// Required: false
	Ports map[string]string `json:"ports,omitempty"`

	// Volumes is a list of volume mounts.
	//
	// Required: false
	Volumes []string `json:"volumes,omitempty"`

	// Networks is a list of networks to connect to.
	//
	// Required: false
	Networks []string `json:"networks,omitempty"`

	// RestartPolicy for the container.
	//
	// Required: false
	RestartPolicy string `json:"restartPolicy,omitempty"`

	// Privileged indicates if the container runs in privileged mode.
	//
	// Required: false
	Privileged bool `json:"privileged,omitempty"`

	// AutoRemove indicates if the container should be removed when stopped.
	//
	// Required: false
	AutoRemove bool `json:"autoRemove,omitempty"`

	// Memory limit for the container in bytes.
	//
	// Required: false
	Memory int64 `json:"memory,omitempty"`

	// CPUs is the number of CPUs to allocate.
	//
	// Required: false
	CPUs float64 `json:"cpus,omitempty"`

	// Credentials for pulling images from private registries.
	//
	// Required: false
	Credentials []containerregistry.Credential `json:"credentials,omitempty"`
}

Create is used to create a new container.

type Created

type Created struct {
	// ID is the unique identifier of the container.
	//
	// Required: true
	ID string `json:"id"`

	// Name of the container.
	//
	// Required: true
	Name string `json:"name"`

	// Image used by the container.
	//
	// Required: true
	Image string `json:"image"`

	// Status of the container.
	//
	// Required: true
	Status string `json:"status"`

	// Created is when the container was created.
	//
	// Required: true
	Created string `json:"created"`
}

Created represents a newly created container.

type Details

type Details struct {
	// ID is the unique identifier of the container.
	//
	// Required: true
	ID string `json:"id"`

	// Name of the container.
	//
	// Required: true
	Name string `json:"name"`

	// Image used by the container.
	//
	// Required: true
	Image string `json:"image"`

	// ImageID is the ID of the image.
	//
	// Required: true
	ImageID string `json:"imageId"`

	// Created is when the container was created.
	//
	// Required: true
	Created string `json:"created"`

	// State contains the container's current state.
	//
	// Required: true
	State State `json:"state"`

	// Config contains container configuration.
	//
	// Required: true
	Config Config `json:"config"`

	// HostConfig contains host-level configuration.
	//
	// Required: true
	HostConfig HostConfig `json:"hostConfig"`

	// NetworkSettings contains network configuration.
	//
	// Required: true
	NetworkSettings NetworkSettings `json:"networkSettings"`

	// Ports exposed by the container.
	//
	// Required: true
	Ports []Port `json:"ports"`

	// Mounts lists volume mounts.
	//
	// Required: true
	Mounts []Mount `json:"mounts"`

	// Labels contains user-defined metadata.
	//
	// Required: false
	Labels map[string]string `json:"labels,omitempty"`

	// ComposeInfo contains Docker Compose project information.
	// Only present if container is part of a Compose project.
	//
	// Required: false
	ComposeInfo *ComposeInfo `json:"composeInfo,omitempty"`

	// IconLightURL is the resolved light icon URL for dark themes.
	//
	// Required: false
	IconLightURL string `json:"iconLightUrl,omitempty"`

	// IconDarkURL is the resolved dark icon URL for light themes.
	//
	// Required: false
	IconDarkURL string `json:"iconDarkUrl,omitempty"`

	// RedeployDisabled indicates whether redeploy actions are disabled for this container.
	//
	// Required: false
	RedeployDisabled bool `json:"redeployDisabled,omitempty"`

	// ActivityID is the background activity that tracked the action returning these details.
	//
	// Required: false
	ActivityID *string `json:"activityId,omitempty"`
}

Details represents detailed container information.

func NewDetails

func NewDetails(c *container.InspectResponse) Details

NewDetails creates a Details from a docker container.InspectResponse.

type Edit added in v2.9.0

type Edit struct {
	// Name is the new container name.
	//
	// Required: false
	Name *string `json:"name,omitempty"`

	// Image reference to run.
	//
	// Required: false
	Image *string `json:"image,omitempty"`

	// WorkingDir is the working directory inside the container.
	//
	// Required: false
	WorkingDir *string `json:"workingDir,omitempty"`

	// User to run the container as.
	//
	// Required: false
	User *string `json:"user,omitempty"`

	// Command to run in the container.
	//
	// Required: false
	Command *[]string `json:"command,omitempty"`

	// Entrypoint for the container.
	//
	// Required: false
	Entrypoint *[]string `json:"entrypoint,omitempty"`

	// Environment variables for the container.
	//
	// Required: false
	Environment *[]string `json:"environment,omitempty"`

	// Labels to set on the container.
	//
	// Required: false
	Labels *map[string]string `json:"labels,omitempty"`

	// Healthcheck replaces the container healthcheck when set.
	//
	// Required: false
	Healthcheck *HealthcheckCreate `json:"healthcheck,omitempty"`

	// ClearHealthcheck reverts to the image-defined healthcheck.
	//
	// Required: false
	ClearHealthcheck bool `json:"clearHealthcheck,omitempty"`

	// HostConfig holds host-level configuration changes.
	//
	// Required: false
	HostConfig *HostConfigEdit `json:"hostConfig,omitempty"`

	// NetworkingConfig is the full desired network endpoint set. Nil preserves
	// the existing attachments.
	//
	// Required: false
	NetworkingConfig *NetworkingConfigCreate `json:"networkingConfig,omitempty"`

	// Credentials for pulling images from private registries.
	//
	// Required: false
	Credentials []containerregistry.Credential `json:"credentials,omitempty"`
}

Edit describes configuration changes to apply when recreating a container. Each form-owned section is a pointer: nil preserves the inspected value, non-nil (even empty) replaces that section. Settings not represented here (sysctls, ulimits, log drivers, devices, tmpfs, DNS, ...) always carry over from the existing container untouched.

type EditConfig added in v2.9.0

type EditConfig struct {
	// ID is the unique identifier of the container.
	//
	// Required: true
	ID string `json:"id"`

	// Name of the container.
	//
	// Required: true
	Name string `json:"name"`

	// Image reference the container was created from.
	//
	// Required: true
	Image string `json:"image"`

	// Command the container runs.
	//
	// Required: false
	Command []string `json:"command,omitempty"`

	// Entrypoint for the container.
	//
	// Required: false
	Entrypoint []string `json:"entrypoint,omitempty"`

	// WorkingDir is the working directory inside the container.
	//
	// Required: false
	WorkingDir string `json:"workingDir,omitempty"`

	// User the container runs as.
	//
	// Required: false
	User string `json:"user,omitempty"`

	// Environment variables of the container.
	//
	// Required: false
	Environment []string `json:"environment,omitempty"`

	// Labels set on the container.
	//
	// Required: false
	Labels map[string]string `json:"labels,omitempty"`

	// Healthcheck configuration (durations in seconds), if the container
	// defines one.
	//
	// Required: false
	Healthcheck *HealthcheckCreate `json:"healthcheck,omitempty"`

	// HostConfig is the host-config subset surfaced by the edit form.
	//
	// Required: true
	HostConfig EditConfigHostConfig `json:"hostConfig"`

	// Networks maps network names to their desired endpoint settings.
	//
	// Required: false
	Networks map[string]EditConfigNetwork `json:"networks,omitempty"`

	// IsCompose indicates the container is managed by a compose project.
	//
	// Required: false
	IsCompose bool `json:"isCompose,omitempty"`

	// ComposeProject is the owning compose project name, if any.
	//
	// Required: false
	ComposeProject string `json:"composeProject,omitempty"`

	// EditDisabled indicates edit actions are disabled for this container.
	//
	// Required: false
	EditDisabled bool `json:"editDisabled,omitempty"`

	// Running indicates whether the container is currently running.
	//
	// Required: true
	Running bool `json:"running"`
}

EditConfig is the read DTO backing the container edit form.

func NewEditConfigFromInspect added in v2.9.0

func NewEditConfigFromInspect(c *container.InspectResponse, isCompose bool, editDisabled bool) EditConfig

NewEditConfigFromInspect builds an EditConfig from a docker inspect response.

type EditConfigHostConfig added in v2.9.0

type EditConfigHostConfig struct {
	// Binds is the list of volume bindings.
	//
	// Required: false
	Binds []string `json:"binds,omitempty"`

	// Mounts is the list of typed mounts.
	//
	// Required: false
	Mounts []MountCreate `json:"mounts,omitempty"`

	// PortBindings maps container ports to host bindings.
	//
	// Required: false
	PortBindings map[string][]PortBindingCreate `json:"portBindings,omitempty"`

	// RestartPolicy for the container.
	//
	// Required: false
	RestartPolicy RestartPolicyCreate `json:"restartPolicy"`

	// NetworkMode for the container.
	//
	// Required: false
	NetworkMode string `json:"networkMode,omitempty"`

	// Privileged indicates if the container runs in privileged mode.
	//
	// Required: false
	Privileged bool `json:"privileged,omitempty"`

	// CapAdd is the list of added kernel capabilities.
	//
	// Required: false
	CapAdd []string `json:"capAdd,omitempty"`

	// CapDrop is the list of dropped kernel capabilities.
	//
	// Required: false
	CapDrop []string `json:"capDrop,omitempty"`

	// AutoRemove indicates if the container is removed when stopped.
	//
	// Required: false
	AutoRemove bool `json:"autoRemove,omitempty"`

	// ReadonlyRootfs indicates a read-only root filesystem.
	//
	// Required: false
	ReadonlyRootfs bool `json:"readonlyRootfs,omitempty"`

	// Memory limit in bytes.
	//
	// Required: false
	Memory int64 `json:"memory,omitempty"`

	// MemorySwap limits total memory usage (memory + swap) in bytes.
	//
	// Required: false
	MemorySwap int64 `json:"memorySwap,omitempty"`

	// NanoCPUs is CPU allocation in nano CPUs.
	//
	// Required: false
	NanoCPUs int64 `json:"nanoCpus,omitempty"`

	// CPUShares is the relative CPU share weight.
	//
	// Required: false
	CPUShares int64 `json:"cpuShares,omitempty"`
}

EditConfigHostConfig is the host-config subset surfaced by the edit form.

type EditConfigNetwork added in v2.9.0

type EditConfigNetwork struct {
	// Aliases for the container on this network.
	//
	// Required: false
	Aliases []string `json:"aliases,omitempty"`

	// IPv4Address is the configured static IPv4 address, if any.
	//
	// Required: false
	IPv4Address string `json:"ipv4Address,omitempty"`

	// IPv6Address is the configured static IPv6 address, if any.
	//
	// Required: false
	IPv6Address string `json:"ipv6Address,omitempty"`
}

EditConfigNetwork describes one desired network attachment as shown in the edit form.

type EndpointSettingsCreate

type EndpointSettingsCreate struct {
	// Aliases for the container on this network.
	//
	// Required: false
	Aliases []string `json:"aliases,omitempty"`

	// IPv4Address is a static IPv4 address for the container on this network.
	//
	// Required: false
	IPv4Address string `json:"ipv4Address,omitempty"`

	// IPv6Address is a static IPv6 address for the container on this network.
	//
	// Required: false
	IPv6Address string `json:"ipv6Address,omitempty"`
}

EndpointSettingsCreate represents network endpoint settings for container creation.

type GenerateComposeRequest added in v2.10.0

type GenerateComposeRequest struct {
	ContainerIDs []string `json:"containerIds" minItems:"1" doc:"IDs of the containers to convert"`
}

GenerateComposeRequest selects the containers to convert into a compose project.

type GenerateComposeResponse added in v2.10.0

type GenerateComposeResponse struct {
	ComposeContent string `json:"composeContent"`
}

GenerateComposeResponse carries the compose file generated from containers.

type Health

type Health struct {
	// Status is the current healthcheck status (starting, healthy, unhealthy, none).
	//
	// Required: true
	Status string `json:"status"`

	// FailingStreak is the number of consecutive failures.
	//
	// Required: false
	FailingStreak int `json:"failingStreak"`

	// Log is the recent probe history, oldest first.
	//
	// Required: false
	Log []HealthLogEntry `json:"log,omitempty"`
}

Health represents the current healthcheck state of a container.

type HealthLogEntry

type HealthLogEntry struct {
	// Start is when the probe started.
	//
	// Required: false
	Start string `json:"start,omitempty"`

	// End is when the probe finished.
	//
	// Required: false
	End string `json:"end,omitempty"`

	// ExitCode is the exit code of the probe command.
	//
	// Required: false
	ExitCode int `json:"exitCode"`

	// Output is the stdout/stderr captured from the probe.
	//
	// Required: false
	Output string `json:"output,omitempty"`
}

HealthLogEntry represents a single probe result from the healthcheck log.

type Healthcheck

type Healthcheck struct {
	// Test is the probe command. Common forms:
	//  - empty / nil: inherit from the image
	//  - ["NONE"]: healthcheck disabled
	//  - ["CMD", "..."] / ["CMD-SHELL", "..."]: probe command
	//
	// Required: false
	Test []string `json:"test,omitempty"`

	// Interval between probes, in nanoseconds.
	//
	// Required: false
	Interval int64 `json:"interval,omitempty"`

	// Timeout for a single probe, in nanoseconds.
	//
	// Required: false
	Timeout int64 `json:"timeout,omitempty"`

	// StartPeriod is the initialization grace period, in nanoseconds.
	//
	// Required: false
	StartPeriod int64 `json:"startPeriod,omitempty"`

	// StartInterval is the probe interval during the start period, in nanoseconds.
	//
	// Required: false
	StartInterval int64 `json:"startInterval,omitempty"`

	// Retries is the number of consecutive failures before the container is marked unhealthy.
	//
	// Required: false
	Retries int `json:"retries,omitempty"`
}

Healthcheck represents a container's healthcheck configuration. Duration values are expressed in nanoseconds (Docker SDK convention).

type HealthcheckCreate added in v2.9.0

type HealthcheckCreate struct {
	// Test is the probe command. ["NONE"] disables an image-defined healthcheck.
	//
	// Required: false
	Test []string `json:"test,omitempty"`

	// Interval between probes, in seconds.
	//
	// Required: false
	Interval int64 `json:"interval,omitempty"`

	// Timeout for a single probe, in seconds.
	//
	// Required: false
	Timeout int64 `json:"timeout,omitempty"`

	// StartPeriod is the initialization grace period, in seconds.
	//
	// Required: false
	StartPeriod int64 `json:"startPeriod,omitempty"`

	// StartInterval is the probe interval during the start period, in seconds.
	//
	// Required: false
	StartInterval int64 `json:"startInterval,omitempty"`

	// Retries is the number of consecutive failures before unhealthy.
	//
	// Required: false
	Retries int `json:"retries,omitempty"`
}

HealthcheckCreate represents a container healthcheck configuration for create/edit requests. Duration values are expressed in seconds on the wire.

type HostConfig

type HostConfig struct {
	// NetworkMode for the container.
	//
	// Required: false
	NetworkMode string `json:"networkMode,omitempty"`

	// RestartPolicy for the container.
	//
	// Required: false
	RestartPolicy string `json:"restartPolicy,omitempty"`

	// Privileged indicates if the container runs in privileged mode.
	//
	// Required: false
	Privileged bool `json:"privileged,omitempty"`

	// AutoRemove indicates if the container is removed when stopped.
	//
	// Required: false
	AutoRemove bool `json:"autoRemove,omitempty"`

	// NanoCPUs is CPU allocation in nano CPUs.
	//
	// Required: false
	NanoCPUs int64 `json:"nanoCpus,omitempty"`

	// Memory limit in bytes.
	//
	// Required: false
	Memory int64 `json:"memory,omitempty"`
}

HostConfig represents host configuration for a container.

type HostConfigCreate

type HostConfigCreate struct {
	// Binds is a list of volume bindings.
	//
	// Required: false
	Binds []string `json:"binds,omitempty"`

	// PortBindings maps container ports to host bindings.
	//
	// Required: false
	PortBindings map[string][]PortBindingCreate `json:"portBindings,omitempty"`

	// RestartPolicy for the container.
	//
	// Required: false
	RestartPolicy *RestartPolicyCreate `json:"restartPolicy,omitempty"`

	// NetworkMode for the container.
	//
	// Required: false
	NetworkMode string `json:"networkMode,omitempty"`

	// Privileged indicates if the container runs in privileged mode.
	//
	// Required: false
	Privileged *bool `json:"privileged,omitempty"`

	// AutoRemove indicates if the container is removed when stopped.
	//
	// Required: false
	AutoRemove *bool `json:"autoRemove,omitempty"`

	// Memory limit in bytes.
	//
	// Required: false
	Memory int64 `json:"memory,omitempty"`

	// MemorySwap limits total memory usage (memory + swap) in bytes.
	//
	// Required: false
	MemorySwap int64 `json:"memorySwap,omitempty"`

	// NanoCPUs is CPU allocation in nano CPUs.
	//
	// Required: false
	NanoCPUs int64 `json:"nanoCpus,omitempty"`

	// CPUShares is the relative CPU share weight.
	//
	// Required: false
	CPUShares int64 `json:"cpuShares,omitempty"`

	// ReadonlyRootfs makes the root filesystem read-only.
	//
	// Required: false
	ReadonlyRootfs *bool `json:"readonlyRootfs,omitempty"`

	// PublishAllPorts publishes all exposed ports to random host ports.
	//
	// Required: false
	PublishAllPorts *bool `json:"publishAllPorts,omitempty"`

	// CapAdd is a list of kernel capabilities to add.
	//
	// Required: false
	CapAdd []string `json:"capAdd,omitempty"`

	// CapDrop is a list of kernel capabilities to drop.
	//
	// Required: false
	CapDrop []string `json:"capDrop,omitempty"`

	// Mounts is a list of typed mounts (bind or volume).
	//
	// Required: false
	Mounts []MountCreate `json:"mounts,omitempty"`
}

HostConfigCreate represents host configuration for container creation.

type HostConfigEdit added in v2.9.0

type HostConfigEdit struct {
	// Binds is the full desired list of volume bindings.
	//
	// Required: false
	Binds *[]string `json:"binds,omitempty"`

	// Mounts is the full desired list of typed mounts.
	//
	// Required: false
	Mounts *[]MountCreate `json:"mounts,omitempty"`

	// PortBindings is the full desired port binding map.
	//
	// Required: false
	PortBindings *map[string][]PortBindingCreate `json:"portBindings,omitempty"`

	// RestartPolicy for the container.
	//
	// Required: false
	RestartPolicy *RestartPolicyCreate `json:"restartPolicy,omitempty"`

	// Privileged indicates if the container runs in privileged mode.
	//
	// Required: false
	Privileged *bool `json:"privileged,omitempty"`

	// CapAdd is the full desired list of added kernel capabilities.
	//
	// Required: false
	CapAdd *[]string `json:"capAdd,omitempty"`

	// CapDrop is the full desired list of dropped kernel capabilities.
	//
	// Required: false
	CapDrop *[]string `json:"capDrop,omitempty"`

	// AutoRemove indicates if the container is removed when stopped.
	//
	// Required: false
	AutoRemove *bool `json:"autoRemove,omitempty"`

	// ReadonlyRootfs makes the root filesystem read-only.
	//
	// Required: false
	ReadonlyRootfs *bool `json:"readonlyRootfs,omitempty"`

	// Memory limit in bytes.
	//
	// Required: false
	Memory *int64 `json:"memory,omitempty"`

	// MemorySwap limits total memory usage (memory + swap) in bytes.
	//
	// Required: false
	MemorySwap *int64 `json:"memorySwap,omitempty"`

	// NanoCPUs is CPU allocation in nano CPUs.
	//
	// Required: false
	NanoCPUs *int64 `json:"nanoCpus,omitempty"`

	// CPUShares is the relative CPU share weight.
	//
	// Required: false
	CPUShares *int64 `json:"cpuShares,omitempty"`
}

HostConfigEdit carries host-level configuration changes for a container edit. Each field is a pointer: nil preserves the existing value, non-nil (even empty) replaces it.

type Mount

type Mount struct {
	// Type of the mount (bind, volume, tmpfs).
	//
	// Required: true
	Type string `json:"type"`

	// Name of the volume (for volume mounts).
	//
	// Required: false
	Name string `json:"name,omitempty"`

	// Source path on the host.
	//
	// Required: false
	Source string `json:"source,omitempty"`

	// Destination path in the container.
	//
	// Required: true
	Destination string `json:"destination"`

	// Driver is the volume driver (for volume mounts).
	//
	// Required: false
	Driver string `json:"driver,omitempty"`

	// Mode specifies mount permissions.
	//
	// Required: false
	Mode string `json:"mode,omitempty"`

	// RW indicates if the mount is read-write.
	//
	// Required: false
	RW bool `json:"rw,omitempty"`

	// Propagation mode for the mount.
	//
	// Required: false
	Propagation string `json:"propagation,omitempty"`
}

Mount represents a volume mount for a container.

type MountCreate added in v2.9.0

type MountCreate struct {
	// Type of the mount (bind or volume).
	//
	// Required: true
	Type string `json:"type"`

	// Source is the host path (bind) or volume name (volume).
	//
	// Required: true
	Source string `json:"source"`

	// Target path inside the container.
	//
	// Required: true
	Target string `json:"target"`

	// ReadOnly mounts the target read-only.
	//
	// Required: false
	ReadOnly bool `json:"readOnly,omitempty"`
}

MountCreate represents a typed mount (bind or volume) for container creation.

type NetworkEndpoint

type NetworkEndpoint struct {
	// IPAMConfig contains IP address management configuration.
	//
	// Required: false
	IPAMConfig any `json:"ipamConfig,omitempty"`

	// Links to other containers.
	//
	// Required: false
	Links []string `json:"links,omitempty"`

	// Aliases for the container on this network.
	//
	// Required: false
	Aliases []string `json:"aliases,omitempty"`

	// MacAddress of the container on this network.
	//
	// Required: false
	MacAddress string `json:"macAddress,omitempty"`

	// DriverOpts contains driver-specific options.
	//
	// Required: false
	DriverOpts map[string]string `json:"driverOpts,omitempty"`

	// GwPriority is the gateway priority.
	//
	// Required: false
	GwPriority int `json:"gwPriority,omitempty"`

	// NetworkID is the ID of the network.
	//
	// Required: false
	NetworkID string `json:"networkId,omitempty"`

	// EndpointID is the ID of this endpoint.
	//
	// Required: false
	EndpointID string `json:"endpointId,omitempty"`

	// Gateway address for the network.
	//
	// Required: false
	Gateway string `json:"gateway,omitempty"`

	// IPAddress assigned to the container.
	//
	// Required: false
	IPAddress string `json:"ipAddress,omitempty"`

	// IPPrefixLen is the IP prefix length.
	//
	// Required: false
	IPPrefixLen int `json:"ipPrefixLen,omitempty"`

	// IPv6Gateway address for the network.
	//
	// Required: false
	IPv6Gateway string `json:"ipv6Gateway,omitempty"`

	// GlobalIPv6Address assigned to the container.
	//
	// Required: false
	GlobalIPv6Address string `json:"globalIPv6Address,omitempty"`

	// GlobalIPv6PrefixLen is the IPv6 prefix length.
	//
	// Required: false
	GlobalIPv6PrefixLen int `json:"globalIPv6PrefixLen,omitempty"`

	// DNSNames are DNS names for this endpoint.
	//
	// Required: false
	DNSNames []string `json:"dnsNames,omitempty"`
}

NetworkEndpoint represents network endpoint settings for a container.

type NetworkSettings

type NetworkSettings struct {
	// Networks is a map of network name to endpoint settings.
	//
	// Required: true
	Networks map[string]NetworkEndpoint `json:"networks"`
}

NetworkSettings contains network configuration for a container.

type NetworkingConfigCreate

type NetworkingConfigCreate struct {
	// EndpointsConfig maps network names to endpoint settings.
	//
	// Required: false
	EndpointsConfig map[string]EndpointSettingsCreate `json:"endpointsConfig,omitempty"`
}

NetworkingConfigCreate represents network configuration for container creation.

type Port

type Port struct {
	// IP address the port is bound to.
	//
	// Required: false
	IP string `json:"ip,omitempty"`

	// PrivatePort is the port inside the container.
	//
	// Required: true
	PrivatePort int `json:"privatePort"`

	// PublicPort is the port on the host.
	//
	// Required: false
	PublicPort int `json:"publicPort,omitempty"`

	// Type is the protocol type (tcp/udp).
	//
	// Required: true
	Type string `json:"type"`
}

Port represents a port binding for a container.

type PortBindingCreate

type PortBindingCreate struct {
	// HostIP is the IP address to bind to on the host.
	//
	// Required: false
	HostIP string `json:"hostIp,omitempty"`

	// HostPort is the port on the host.
	//
	// Required: false
	HostPort string `json:"hostPort,omitempty"`
}

PortBindingCreate represents host port bindings for container creation.

type RestartPolicyCreate

type RestartPolicyCreate struct {
	// Name of the restart policy.
	//
	// Required: false
	Name string `json:"name,omitempty"`

	// MaximumRetryCount is only used when name is on-failure.
	//
	// Required: false
	MaximumRetryCount int `json:"maximumRetryCount,omitempty"`
}

RestartPolicyCreate represents restart policy options for container creation.

type State

type State struct {
	// Status is the current status of the container.
	//
	// Required: true
	Status string `json:"status"`

	// Running indicates if the container is running.
	//
	// Required: true
	Running bool `json:"running"`

	// ExitCode is the exit code of the container process.
	//
	// Required: false
	ExitCode int `json:"exitCode,omitempty"`

	// StartedAt is when the container was started.
	//
	// Required: false
	StartedAt string `json:"startedAt,omitempty"`

	// FinishedAt is when the container finished.
	//
	// Required: false
	FinishedAt string `json:"finishedAt,omitempty"`

	// Health contains the healthcheck status, if the container defines one.
	//
	// Required: false
	Health *Health `json:"health,omitempty"`
}

State represents the state of a container.

type StatusCounts

type StatusCounts struct {
	// RunningContainers is the number of running containers.
	//
	// Required: true
	RunningContainers int `json:"runningContainers"`

	// StoppedContainers is the number of stopped containers.
	//
	// Required: true
	StoppedContainers int `json:"stoppedContainers"`

	// TotalContainers is the total number of containers.
	//
	// Required: true
	TotalContainers int `json:"totalContainers"`
}

StatusCounts contains counts of containers by status.

type Summary

type Summary struct {
	// ID is the unique identifier of the container.
	//
	// Required: true
	ID string `json:"id"`

	// Names is a list of names for the container.
	//
	// Required: true
	Names []string `json:"names"`

	// Image used by the container.
	//
	// Required: true
	Image string `json:"image"`

	// ImageID is the ID of the image.
	//
	// Required: true
	ImageID string `json:"imageId"`

	// Command running in the container.
	//
	// Required: true
	Command string `json:"command"`

	// Created is the Unix timestamp when the container was created.
	//
	// Required: true
	Created int64 `json:"created"`

	// Ports exposed by the container.
	//
	// Required: true
	Ports []Port `json:"ports"`

	// Labels contains user-defined metadata.
	//
	// Required: true
	Labels map[string]string `json:"labels"`

	// State is the current state of the container.
	//
	// Required: true
	State string `json:"state"`

	// Status provides a human-readable status.
	//
	// Required: true
	Status string `json:"status"`

	// HostConfig contains host configuration.
	//
	// Required: true
	HostConfig HostConfig `json:"hostConfig"`

	// NetworkSettings contains network configuration.
	//
	// Required: true
	NetworkSettings NetworkSettings `json:"networkSettings"`

	// Mounts lists volume mounts.
	//
	// Required: true
	Mounts []Mount `json:"mounts"`

	// IconLightURL is the resolved light icon URL for dark themes.
	//
	// Required: false
	IconLightURL string `json:"iconLightUrl,omitempty"`

	// IconDarkURL is the resolved dark icon URL for light themes.
	//
	// Required: false
	IconDarkURL string `json:"iconDarkUrl,omitempty"`

	// UpdateInfo contains image update information for this container.
	//
	// Required: false
	UpdateInfo *imagetypes.UpdateInfo `json:"updateInfo,omitempty"`

	// RedeployDisabled indicates whether redeploy actions are disabled for this container.
	//
	// Required: false
	RedeployDisabled bool `json:"redeployDisabled,omitempty"`
}

Summary represents a container summary.

func NewSummary

func NewSummary(c container.Summary) Summary

NewSummary creates a Summary from a docker container.Summary.

type SummaryGroup

type SummaryGroup struct {
	// GroupName is the group label, such as a compose project name.
	//
	// Required: true
	GroupName string `json:"groupName"`

	// Items contains the container summaries in the group.
	//
	// Required: true
	Items []Summary `json:"items"`
}

SummaryGroup represents a group of container summaries.

Jump to

Keyboard shortcuts

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