Documentation ¶
Index ¶
- Variables
- func CopyFileToVolume(ctx context.Context, volumeName string, sourcePath string, destPath string) error
- func CopyFromContainer(ctx context.Context, containerName string, sourcePath string, destPath string) error
- func CreateVolume(ctx context.Context, volumeName string) error
- func GetImageConfig(image string) (map[string]interface{}, error)
- func GetImageDigest(image string) (string, error)
- func GetImageLabel(image, label string) (string, error)
- func MkdirInVolume(ctx context.Context, volumeName string, directory string) error
- func RemoveVolume(ctx context.Context, volumeName string) error
- func RunDockerCommand(ctx context.Context, workingDir string, command ...string) error
- func RunDockerCommandBuffered(ctx context.Context, workingDir string, command ...string) (string, error)
- func RunDockerCommandLine(ctx context.Context, workingDir string, command string) error
- func RunDockerCommandRetry(ctx context.Context, workingDir string, retries int, command ...string) error
- func RunDockerComposeCommand(ctx context.Context, workingDir string, command ...string) error
- func RunDockerComposeCommandReturnsStdout(workingDir string, command ...string) ([]byte, error)
- type CtxComposeVersionKey
- type CtxIsLogCmdKey
- type DependsOn
- type DockerComposeConfig
- type DockerComposeVersion
- type DockerManager
- func (mgr *DockerManager) CopyFileToVolume(ctx context.Context, volumeName string, sourcePath string, destPath string) error
- func (mgr *DockerManager) CopyFromContainer(ctx context.Context, containerName string, sourcePath string, destPath string) error
- func (mgr *DockerManager) CreateVolume(ctx context.Context, volumeName string) error
- func (mgr *DockerManager) GetImageConfig(image string) (map[string]interface{}, error)
- func (mgr *DockerManager) GetImageDigest(image string) (string, error)
- func (mgr *DockerManager) GetImageLabel(image, label string) (string, error)
- func (mgr *DockerManager) MkdirInVolume(ctx context.Context, volumeName string, directory string) error
- func (mgr *DockerManager) RemoveVolume(ctx context.Context, volumeName string) error
- func (mgr *DockerManager) RunDockerCommand(ctx context.Context, workingDir string, command ...string) error
- func (mgr *DockerManager) RunDockerCommandBuffered(ctx context.Context, workingDir string, command ...string) (string, error)
- func (mgr *DockerManager) RunDockerCommandLine(ctx context.Context, workingDir string, command string) error
- func (mgr *DockerManager) RunDockerComposeCommand(ctx context.Context, workingDir string, command ...string) error
- func (mgr *DockerManager) RunDockerComposeCommandReturnsStdout(workingDir string, command ...string) ([]byte, error)
- type HealthCheck
- type IDockerManager
- type LoggingConfig
- type Service
- type ServiceDefinition
Constants ¶
This section is empty.
Variables ¶
View Source
var StandardLogOptions = &LoggingConfig{ Driver: "json-file", Options: map[string]string{ "max-size": "10m", "max-file": "1", }, }
Functions ¶
func CopyFileToVolume ¶
func CopyFromContainer ¶ added in v0.0.36
func GetImageConfig ¶ added in v1.0.2
func GetImageDigest ¶ added in v1.0.2
func GetImageLabel ¶ added in v1.0.2
func MkdirInVolume ¶
func RunDockerCommand ¶
func RunDockerCommandBuffered ¶ added in v0.0.36
func RunDockerCommandLine ¶ added in v1.3.0
func RunDockerCommandRetry ¶ added in v0.0.35
func RunDockerComposeCommand ¶
Types ¶
type CtxComposeVersionKey ¶ added in v1.2.0
type CtxComposeVersionKey struct{}
type CtxIsLogCmdKey ¶ added in v1.2.0
type CtxIsLogCmdKey struct{}
type DockerComposeConfig ¶
type DockerComposeConfig struct { Version string `yaml:"version,omitempty"` Services map[string]*Service `yaml:"services,omitempty"` Volumes map[string]struct{} `yaml:"volumes,omitempty"` }
func CreateDockerCompose ¶
func CreateDockerCompose(s *types.Stack) *DockerComposeConfig
type DockerComposeVersion ¶ added in v1.2.0
type DockerComposeVersion int
const ( None DockerComposeVersion = iota ComposeV1 ComposeV2 )
func CheckDockerConfig ¶ added in v0.0.36
func CheckDockerConfig() (DockerComposeVersion, error)
type DockerManager ¶ added in v1.3.1
type DockerManager struct{}
DockerManager implements IDockerManager
func NewDockerManager ¶ added in v1.3.1
func NewDockerManager() *DockerManager
func (*DockerManager) CopyFileToVolume ¶ added in v1.3.1
func (*DockerManager) CopyFromContainer ¶ added in v1.3.1
func (*DockerManager) CreateVolume ¶ added in v1.3.1
func (mgr *DockerManager) CreateVolume(ctx context.Context, volumeName string) error
func (*DockerManager) GetImageConfig ¶ added in v1.3.1
func (mgr *DockerManager) GetImageConfig(image string) (map[string]interface{}, error)
func (*DockerManager) GetImageDigest ¶ added in v1.3.1
func (mgr *DockerManager) GetImageDigest(image string) (string, error)
func (*DockerManager) GetImageLabel ¶ added in v1.3.1
func (mgr *DockerManager) GetImageLabel(image, label string) (string, error)
func (*DockerManager) MkdirInVolume ¶ added in v1.3.1
func (*DockerManager) RemoveVolume ¶ added in v1.3.1
func (mgr *DockerManager) RemoveVolume(ctx context.Context, volumeName string) error
func (*DockerManager) RunDockerCommand ¶ added in v1.3.1
func (*DockerManager) RunDockerCommandBuffered ¶ added in v1.3.1
func (*DockerManager) RunDockerCommandLine ¶ added in v1.3.1
func (*DockerManager) RunDockerComposeCommand ¶ added in v1.3.1
func (*DockerManager) RunDockerComposeCommandReturnsStdout ¶ added in v1.3.1
func (mgr *DockerManager) RunDockerComposeCommandReturnsStdout(workingDir string, command ...string) ([]byte, error)
type HealthCheck ¶
type IDockerManager ¶ added in v1.3.1
type IDockerManager interface { // Command Execution RunDockerCommand(ctx context.Context, workingDir string, command ...string) error RunDockerCommandLine(ctx context.Context, workingDir string, command string) error RunDockerComposeCommand(ctx context.Context, workingDir string, command ...string) error RunDockerCommandBuffered(ctx context.Context, workingDir string, command ...string) (string, error) RunDockerComposeCommandReturnsStdout(workingDir string, command ...string) ([]byte, error) // Image Inspection GetImageConfig(image string) (map[string]interface{}, error) GetImageLabel(image, label string) (string, error) GetImageDigest(image string) (string, error) // Volume Management CreateVolume(ctx context.Context, volumeName string) error CopyFileToVolume(ctx context.Context, volumeName string, sourcePath string, destPath string) error MkdirInVolume(ctx context.Context, volumeName string, directory string) error RemoveVolume(ctx context.Context, volumeName string) error // Container Interaction CopyFromContainer(ctx context.Context, containerName string, sourcePath string, destPath string) error }
DockerInterface combines all Docker-related operations into a single interface.
type LoggingConfig ¶
type Service ¶
type Service struct { ContainerName string `yaml:"container_name,omitempty"` Image string `yaml:"image,omitempty"` Build string `yaml:"build,omitempty"` User string `yaml:"user,omitempty"` Command string `yaml:"command,omitempty"` Environment map[string]interface{} `yaml:"environment,omitempty"` Volumes []string `yaml:"volumes,omitempty"` Ports []string `yaml:"ports,omitempty"` DependsOn map[string]map[string]string `yaml:"depends_on,omitempty"` HealthCheck *HealthCheck `yaml:"healthcheck,omitempty"` Logging *LoggingConfig `yaml:"logging,omitempty"` WorkingDir string `yaml:"working_dir,omitempty"` EntryPoint []string `yaml:"entrypoint,omitempty"` EnvFile string `yaml:"env_file,omitempty"` Expose []int `yaml:"expose,omitempty"` Deploy map[string]interface{} `yaml:"deploy,omitempty"` Platform string `yaml:"platform,omitempty"` }
type ServiceDefinition ¶
Click to show internal directories.
Click to hide internal directories.