dockerCliWrapper

package
v0.0.0-...-e0f34cb Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckContainerConfig

func CheckContainerConfig(cfg *ContainerCfg) error

Types

type BuildCfg

type BuildCfg struct {
	ImageName   string
	TarFile     string
	ProjectName string
}

type ContainerCfg

type ContainerCfg struct {
	Image         string   `json:"image" yml:"image"`
	ContainerName string   `json:"container_name" yml:"container_name"`
	Hostname      string   `json:"hostname" yml:"hostname"`
	Networks      []string `json:"networks" yml:"networks"`
	Volumes       []string `json:"volumes" yml:"volumes"`
	Environment   []string `json:"environment" yml:"environment"`
	Restart       string   `json:"restart" yml:"restart"`
}

type DockerCliCfg

type DockerCliCfg struct {
	//以下是server Damemon相关
	DockerSeverIp    string
	DockerSeverPort  string
	DockerApiVersion string
}

type DockerCliWrapper

type DockerCliWrapper struct {
	DockerCli    *dockerclient.Client
	DockerCliCfg DockerCliCfg
}

func NewClient

func NewClient(dockerCliCfg *DockerCliCfg) (*DockerCliWrapper, error)

func (*DockerCliWrapper) BuildImage

func (cli *DockerCliWrapper) BuildImage(cfg *BuildCfg) error

func (*DockerCliWrapper) Close

func (cli *DockerCliWrapper) Close() error

func (*DockerCliWrapper) IsContainerRunning

func (cli *DockerCliWrapper) IsContainerRunning(name string) bool

func (*DockerCliWrapper) PushImage

func (cli *DockerCliWrapper) PushImage(cfg *PushCfg) error

func (*DockerCliWrapper) RemoveContainer

func (cli *DockerCliWrapper) RemoveContainer(containername string) error

func (*DockerCliWrapper) StartContainer

func (cli *DockerCliWrapper) StartContainer(cfg *ContainerCfg) error

type PushCfg

type PushCfg struct {
	RegistryUser     string `json:"registryUsr" yml:"registryUsr"`
	RegistryPassword string `json:"registryPass" yml:"registryPass"`
	RegistryIP       string `json:"registryIP" yml:"registryIP"`
	RegistryPort     string `json:"registryPort" yml:"registryPort"`
	Image            string
}

Jump to

Keyboard shortcuts

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