docker

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	Id        string `json:"ID"`
	CreatedAt string `json:"CreatedAt"`
	Name      string `json:"Names"`
	State     string `json:"State"`
	Labels    string `json:"Labels"`
}

func (*Container) ComposeProjectName

func (c *Container) ComposeProjectName() string

Full project name with stack prefix

func (*Container) LabelValue

func (c *Container) LabelValue(labelName string) string

func (*Container) ProjectName

func (c *Container) ProjectName() string

Project name without the stack prefix

func (*Container) ServiceName

func (c *Container) ServiceName() string

type DockerCmd

type DockerCmd struct {
	Config *config.Config
	Cmd    string
	Args   []string
}

func NewDockerCmd

func NewDockerCmd(cfg *config.Config) *DockerCmd

func (*DockerCmd) BuildProjectCommand

func (dc *DockerCmd) BuildProjectCommand(p *project.Project, noCache bool) *DockerCmd

func (*DockerCmd) CreateAndStartProjectCommand

func (dc *DockerCmd) CreateAndStartProjectCommand(p *project.Project, recreate, update bool) *DockerCmd

func (*DockerCmd) DockerCommand

func (dc *DockerCmd) DockerCommand() *DockerCmd

Start building a docker command

func (*DockerCmd) DockerComposeCommand

func (dc *DockerCmd) DockerComposeCommand() *DockerCmd

Start building a docker compose command

func (*DockerCmd) Execute

func (dc *DockerCmd) Execute() error

func (*DockerCmd) ExecuteWithOutput

func (dc *DockerCmd) ExecuteWithOutput() ([]string, error)

func (*DockerCmd) FetchAllContainersCommand

func (dc *DockerCmd) FetchAllContainersCommand(includeStopped bool) *DockerCmd

FetchAllContainersCommand uses docker ps command (not docker compose) to fetch containers Filtering is done by project prefix which must be a part of container name to make it work Docker compose configuration must define container name as: container_name: $COMPOSE_PROJECT_NAME-service_name_here

It is not possible to list all containers using docker compose command because --project-name argument is mandatory

func (*DockerCmd) FetchImagesCommand

func (dc *DockerCmd) FetchImagesCommand(p *project.Project) *DockerCmd

func (*DockerCmd) FetchProjectContainersCommand

func (dc *DockerCmd) FetchProjectContainersCommand(p *project.Project) *DockerCmd

func (*DockerCmd) FetchProjectsCommand

func (dc *DockerCmd) FetchProjectsCommand(includeStopped bool) *DockerCmd

func (*DockerCmd) LoginAws

func (dc *DockerCmd) LoginAws() error

func (*DockerCmd) LogsCommand

func (dc *DockerCmd) LogsCommand(p *project.Project, opts LogsOptions) *DockerCmd

func (*DockerCmd) OpenCode

func (dc *DockerCmd) OpenCode(c *Container, dir string) error

func (*DockerCmd) RemoveImageCommand

func (dc *DockerCmd) RemoveImageCommand(id string) *DockerCmd

func (*DockerCmd) RemoveProjectCommand

func (dc *DockerCmd) RemoveProjectCommand(p *project.Project) *DockerCmd

func (*DockerCmd) RestartProjectCommand

func (dc *DockerCmd) RestartProjectCommand(p *project.Project) *DockerCmd

func (*DockerCmd) Slice

func (dc *DockerCmd) Slice() []string

func (*DockerCmd) StopProjectCommand

func (dc *DockerCmd) StopProjectCommand(p *project.Project) *DockerCmd

func (*DockerCmd) String

func (dc *DockerCmd) String() string

func (*DockerCmd) TerminalCommand

func (dc *DockerCmd) TerminalCommand(p *project.Project, cmd []string) *DockerCmd

func (*DockerCmd) WithArgs

func (dc *DockerCmd) WithArgs(args ...string) *DockerCmd

func (*DockerCmd) WithProjectFilter

func (dc *DockerCmd) WithProjectFilter() *DockerCmd

func (*DockerCmd) WithProjectName

func (dc *DockerCmd) WithProjectName(p *project.Project) *DockerCmd

func (*DockerCmd) WithSidecarProfile

func (dc *DockerCmd) WithSidecarProfile() *DockerCmd

type Image

type Image struct {
	Id            string `json:"ID"`
	ContainerName string `json:"ContainerName"`
	Repository    string `json:"Repository"`
	Tag           string `json:"Tag"`
	Size          uint64 `json:"Size"`
}

type LogsOptions

type LogsOptions struct {
	FollowOutput   bool
	ShowTimestamps bool
}

Jump to

Keyboard shortcuts

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