docker

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelNamespace       = "com.docker.stack.namespace"
	LabelImage           = "com.docker.stack.image"
	DefaultNetworkDriver = "overlay"
)
View Source
const (
	ResolveImageAlways  = "always"
	ResolveImageChanged = "changed"
	ResolveImageNever   = "never"
)

Variables

View Source
var ErrManagerNotFound = errors.New("manager not found")

Functions

func AddStackLabel

func AddStackLabel(stack string, labels types.Labels) map[string]string

func Build

func Build(ctx context.Context, dockerClient client.APIClient, project types.Project, opt BuildOptions) error

func ConvertConfigs

func ConvertConfigs(stack string, configs types.Configs) ([]swarm.ConfigSpec, error)

func ConvertNetworks

func ConvertNetworks(stack string, networks types.Networks, serviceNetworks map[string]struct{}) (map[string]client.NetworkCreateOptions, []string)

func ConvertSecrets

func ConvertSecrets(stack string, secrets types.Secrets) ([]swarm.SecretSpec, error)

func ConvertServices

func ConvertServices(ctx context.Context, apiClient client.APIClient, stack string, project types.Project) (map[string]swarm.ServiceSpec, error)

func Deploy

func Deploy(ctx context.Context, dockerClient client.APIClient, project types.Project, opts DeployOptions) error

func GetManagerClient

func GetManagerClient(ctx context.Context, servers map[string]vault.Server) (client.APIClient, string, error)

func GetServicesDeclaredNetworks

func GetServicesDeclaredNetworks(serviceConfigs types.Services) map[string]struct{}

func HasBuildConfig

func HasBuildConfig(project types.Project) bool

func LoadCompose

func LoadCompose(ctx context.Context, cwd string, paths ...string) (types.Project, error)

func NewClientSSH

func NewClientSSH(host string, port int, user string, privateKey []byte) (client.APIClient, error)

func PushImage

func PushImage(ctx context.Context, dockerClient client.APIClient, imageName string, registries map[string]registry.AuthConfig) error

func ScopeName

func ScopeName(stack, name string) string

ScopeName adds the stack namespace prefix to a name

Types

type BuildOptions

type BuildOptions struct {
	Services   map[string]bool
	Registries map[string]registry.AuthConfig
	NoCache    bool
	Pull       bool
	Push       bool
	Out        io.Writer
}

type DeployOptions

type DeployOptions struct {
	Secrets      vault.Secrets
	Stack        string
	Prune        bool
	ResolveImage string
	Quiet        bool
	Registries   map[string]registry.AuthConfig
	Out          io.Writer
}

Jump to

Keyboard shortcuts

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