docker

package
v0.0.0-...-5fda629 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: MulanPSL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerInformation

type ContainerInformation struct {
	Name  string
	Image string
	CID   string
	GUID  string
	ENV   map[string]string

	//新增 SERVE gitlab-runner字段
	ImagePullPolicy          string
	Lifecycle                map[string]string
	LivenessProbe            map[string]string
	ReadinessProbe           map[string]string
	Reasources               map[string]string
	SecurityContext          map[string]string
	VolumeMounts             map[string]string
	TerminationMessagePath   []string
	TerminationMessagePolicy []string
}

func (*ContainerInformation) GetEnvStr

func (i *ContainerInformation) GetEnvStr() []string

type Controller

type Controller interface {
	Contains(imageTag string) (bool, error)
	ListTags() ([]string, error)
	ListContainIds() ([]string, error)
	DeleteTag(imageTag string) error
	UploadTag(imageTag string) error
	LoadTag(imageTag string) error
	StartStrategy(imageTag string, containerName string, envs map[string]string) (*ContainerInformation, error)
	StartStrategyWithPort(imageTag string, containerName string, envs map[string]string, port string) (*ContainerInformation, error)
	StartContainer(imageTag string, containerName string, envs map[string]string) (*ContainerInformation, error)
	StartContainerWithPorts(tag, name string, envs map[string]string, ports map[string]string) (*ContainerInformation, error)
	StartContainerWithPortsForCar(tag, name string, envs map[string]string, ports map[string]string) (*ContainerInformation, error)
	StartContainerWithPortsForAgent(tag, name, runtime, workDir, ImagePullPolicy string, envs, ports, Lifecycle, LivenessProbe, ReadinessProbe, Reasources, SecurityContext, VolumeMounts map[string]string, cmds, TerminationMessagePath, TerminationMessagePolicy []string) (*ContainerInformation, error)
	Stop(containerId string) error
	ReStart(containerId string) error
	Resume(containerId string) error
	Remove(containerId string) error
	Log(containerId string) (string, error)
	LogChan(id string) (*LogWriter, func() error, error)
	Close() error
	GetContainerStats(containerId string) (*types.StatsJSON, error)
	ContainerExec(containerId string, cmd []string) error
}

func NewDockerController

func NewDockerController(ctx context.Context, url string) (Controller, error)

type LogWriter

type LogWriter struct {
	// contains filtered or unexported fields
}

func NewLoggerWriter

func NewLoggerWriter() *LogWriter

func (*LogWriter) GetChan

func (r *LogWriter) GetChan() <-chan string

func (*LogWriter) Write

func (r *LogWriter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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