Documentation
¶
Overview ¶
Package compose loads docker-compose projects into the IR.
The compose-spec loader does the parsing, so QuadDoc inherits its handling of interpolation, extends, merge order, and the rest. What this package adds is the mapping onto Quadlet's model, and honesty about what does not map: an unsupported key produces a finding, never a silent drop.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dependency ¶
type Dependency struct {
Service string
// Condition is `service_started`, `service_healthy`, or
// `service_completed_successfully`.
Condition string
}
Dependency is one `depends_on` edge.
type HealthCheck ¶
type HealthCheck struct {
Test []string
Interval string
Timeout string
StartPeriod string
Retries int
Disabled bool
}
HealthCheck is a compose healthcheck.
type Mount ¶
type Mount struct {
// Type is `bind`, `volume`, or `tmpfs`.
Type string
// Source is an absolute host path for a bind, or a volume name.
Source string
Target string
// ReadOnly is the `:ro` flag.
ReadOnly bool
// SELinux carries a `z` or `Z` if the compose file already set one.
SELinux string
}
Mount is one volume entry, already resolved by the compose loader.
type Network ¶
type Network struct {
Name string
Driver string
Internal bool
Labels map[string]string
External bool
// Subnets are the configured IPAM subnets.
Subnets []string
Gateway string
}
Network is a declared network.
type Port ¶
Port is one published port.
func (Port) PublishedPort ¶
PublishedPort renders a port for `PublishPort=`.
type Project ¶
type Project struct {
// Name is the compose project name, used to name the generated network.
Name string
// Services are the compose services, sorted by name for determinism.
Services []Service
// Volumes are the declared named volumes, sorted.
Volumes []Volume
// Networks are the declared networks, sorted.
Networks []Network
// Unsupported records compose features that have no faithful Quadlet
// translation, so they can be reported rather than dropped.
Unsupported []Unsupported
// WorkingDir is the directory the compose file was loaded from.
WorkingDir string
}
Project is a loaded compose project, together with what could not be translated.
type Service ¶
type Service struct {
Name string
Image string
Command []string
Entrypoint []string
User string
WorkingDir string
Hostname string
Restart string
Environment []EnvVar
Volumes []Mount
Ports []Port
Networks []string
DependsOn []Dependency
HealthCheck *HealthCheck
CapAdd []string
CapDrop []string
Devices []string
DNS []string
Labels map[string]string
GroupAdd []string
ReadOnly bool
Privileged bool
ShmSize string
StopSignal string
Sysctls map[string]string
Tmpfs []string
}
Service is one compose service.
type Unsupported ¶
type Unsupported struct {
// Service is the service it appeared on, empty for a top-level key.
Service string
// Key is the compose key, e.g. `build`.
Key string
// Reason explains why it cannot be translated, and what to do instead.
Reason string
}
Unsupported is a compose feature with no faithful Quadlet translation.