podmancomposer

package module
v0.0.0-...-6ee2842 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

README

Goal

The goal of this project is to have an application that reads all versions of docker-compose.yml files and send commands to podman such that podman will build containers and associated resources as docker will when instructed by docker-compose.

Initial work based on podman-compose.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessCommands

func ProcessCommands(input Input) error

Types

type Build

type Build struct {
	Context    string              `yaml:"context"`
	Dockerfile string              `yaml:"dockerfile,omitempty"`
	Args       MapOrListOfString   `yaml:"args,omitempty"`
	SSH        []string            `yaml:"ssh,omitempty"`
	CacheFrom  []string            `yaml:"cache_from,omitempty"`  // [NAME|type=TYPE[,KEY=VALUE]].
	CacheTo    []string            `yaml:"cache_to,omitempty"`    // [NAME|type=TYPE[,KEY=VALUE]].
	ExtraHosts []string            `yaml:"extra_hosts,omitempty"` // Compose implementations MUST create matching entry with the IP address and hostname in the container's network configuration.
	Isolation  []string            `yaml:"isolation,omitempty"`
	Privileged bool                `yaml:"privileged,omitempty"`
	Labels     MapOrListOfString   `yaml:"labels,omitempty"`
	NoCache    bool                `yaml:"no_cache,omitempty"`
	Pull       bool                `yaml:"pull,omitempty"`
	ShmSize    StringOrInt         `yaml:"shm_size"`
	Target     string              `yaml:"target,omitempty"`
	Secrets    []MapOrListOfString `yaml:"secrets,omitempty"`
	Tags       []string            `yaml:"tags,omitempty"`
	Platforms  []string            `yaml:"platforms,omitempty"`
	Networks   []string            `yaml:"networks,omitempty"`
	Volumes    []string            `yaml:"volumes,omitempty"`
}

type BuildSecret

type BuildSecret struct {
	Source string `yaml:"source"`
	Target string `yaml:"target"`
	UID    string `yaml:"uid"`
	GID    string `yaml:"gid"`
	Mode   int    `yaml:"mode"` // This is octal.
}

type Compose

type Compose struct {
	Version  string             `yaml:"version,omitempty"`
	Services map[string]Service `yaml:"services"`
	Networks []Network          `yaml:"networks,omitempty"`
	Volumes  []Volume           `yaml:"volumes,omitempty"`
	Configs  []Config           `yaml:"configs,omitempty"`
	Secrets  map[string]Secret  `yaml:"secrets,omitempty"`
}

type Config

type Config struct {
	File     string `yaml:"file"`
	External bool   `yaml:"external"`
	Name     string `yaml:"name"`
}

type Deploy

type Deploy struct {
	EndpointMode   string              `yaml:"endpoint_mode,omitempty"`
	Labels         map[string]string   `yaml:"labels,omitempty"`
	Mode           string              `yaml:"mode,omitempty"`
	Placement      DeployPlacement     `yaml:"placement,omitempty"`
	Replicas       int32               `yaml:"replicas,omitempty"`
	Resources      DeployResources     `yaml:"resources,omitempty"`
	RestartPolicy  DeployRestartPolicy `yaml:"restart_policy,omitempty"`
	RollbackConfig DeployConfig        `yaml:"rollback_config,omitempty"`
	UpdateConfig   DeployConfig        `yaml:"update_config,omitempty"`
}

type DeployConfig

type DeployConfig struct {
	Parallelism     int           `yaml:"parallelism,omitempty"`
	Delay           time.Duration `yaml:"delay,omitempty"`
	FailureAction   string        `yaml:"failure_action,omitempty"`
	Monitor         time.Duration `yaml:"monitor,omitempty"`
	MaxFailureRatio int           `yaml:"max_failure_ratio,omitempty"`
	Order           string        `yaml:"order,omitempty"`
}

type DeployPlacement

type DeployPlacement struct {
	Constraints MapOrListOfString `yaml:"constraints,omitempty"`
	Preferences MapOrListOfString `yaml:"preferences,omitempty"`
}

type DeployResources

type DeployResources struct {
	Limits       Resources `yaml:"limits,omitempty"`
	Reservations Resources `yaml:"reservations,omitempty"`
}

type DeployRestartPolicy

type DeployRestartPolicy struct {
	Condition   string        `yaml:"condition,omitempty"`
	Delay       time.Duration `yaml:"delay,omitempty"`
	MaxAttempts int           `yaml:"max_attempts,omitempty"`
	Window      time.Duration `yaml:"window,omitempty"`
}

type IPAM

type IPAM struct {
	Driver string     `yaml:"driver"`
	Config IPAMConfig `yaml:"config"`
}

type IPAMConfig

type IPAMConfig struct {
	Subnet       string            `yaml:"subnet"`
	IPRange      string            `yaml:"ip_range"`
	Gateway      string            `yaml:"gateway"`
	AuxAddresses map[string]string `yaml:"aux_addresses"`
	Options      map[string]any    `yaml:"options"`
}

type Input

type Input struct {
	Files         []string
	Project       string
	Profile       string
	Verbose       bool
	LogLevel      string
	Ansi          bool
	Version       bool
	Host          string
	TLS           bool
	TLSCACert     string
	TLSCert       string
	TLSKey        string
	TLSVerify     bool
	SkipHostname  bool
	ProjectDir    string
	Compatibility bool
	Args          []string
}

Input - received from user.

type MapOrListOfString

type MapOrListOfString interface{}

type Network

type Network struct {
	Driver     string            `yaml:"driver"`
	External   bool              `yaml:"external"`
	Name       string            `yaml:"name"`
	DriverOpts []map[string]any  `yaml:"driver_opts"`
	Attachable bool              `yaml:"attachable"`
	EnableIPv6 bool              `yaml:"enable_ipv6"`
	IPAM       IPAM              `yaml:"ipam"`
	Internal   bool              `yaml:"internal"`
	Labels     MapOrListOfString `yaml:"labels"`
}

type ResourceDevice

type ResourceDevice struct {
	Capabilities MapOrListOfString `yaml:"capabilities,omitempty"`
	Driver       string            `yaml:"driver,omitempty"`
	Count        StringOrInt       `yaml:"count,omitempty"`
	DeviceIDs    []string          `yaml:"device_ids,omitempty"`
	Options      map[string]string `yaml:"options,omitempty"`
}

type Resources

type Resources struct {
	CPUs    StringOrInt      `yaml:"cpus,omitempty"`
	Memory  StringOrInt      `yaml:"memory,omitempty"`
	PIDs    int32            `yaml:"pids,omitempty"`
	Devices []ResourceDevice `yaml:"devices,omitempty"`
}

type Secret

type Secret struct {
	File        string `yaml:"file,omitempty"`
	Environment string `yaml:"environment,omitempty"`
	External    bool   `yaml:"external,omitempty"`
	Name        string `yaml:"name,omitempty"`
}

type Service

type Service struct {
	Image       string            `yaml:"image,omitempty"`
	Ports       MapOrListOfString `yaml:"ports,omitempty"`
	Deploy      Deploy            `yaml:"deploy,omitempty"`
	Profiles    []string          `yaml:"profiles,omitempty"`
	Version     string            `yaml:"version,omitempty"`
	Environment []string          `yaml:"environment,omitempty"`
	Build       Build             `yaml:"build,omitempty"`
}

type StringOrInt

type StringOrInt interface{}

type Volume

type Volume struct {
	Driver     string            `yaml:"driver"`
	DriverOpts map[string]string `yaml:"driver_opts"`
	External   bool              `yaml:"external"`
	Labels     MapOrListOfString `yaml:"labels"`
	Name       string            `yaml:"name"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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