docker

package
v0.0.42 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RunOption

type RunOption struct {
	ImageName      string
	Tag            string
	IP             string
	DockerPort     int
	DockerfilePath string
	//the Script is used to run several commands in entrypoint
	Script      string
	JenkinsPort int
	WarPath     string
	//the TmpDir stores Dockerfile and Script
	TmpDir string
}

RunOption contains some of the options used to create a docker image and run a container

var DockerRunOption RunOption

DockerRunOption is an option for starting a container in docker

func (*RunOption) BuildImage

func (o *RunOption) BuildImage(cmd *cobra.Command) error

BuildImage is used to build an image

func (*RunOption) ConnectToDocker

func (o *RunOption) ConnectToDocker() (cli *client.Client, err error)

ConnectToDocker returns a client which is used to connect to a local or remote docker host

func (*RunOption) CreateDockerfile

func (o *RunOption) CreateDockerfile(cmd *cobra.Command, args []string) (err error)

CreateDockerfile will create a docker file for running a jenkins war contains plugins hpi

func (*RunOption) CreateImageAndRunContainer

func (o *RunOption) CreateImageAndRunContainer(cmd *cobra.Command, args []string) (err error)

CreateImageAndRunContainer is to create an docker image and run a container from the image

func (*RunOption) GetTarReader

func (o *RunOption) GetTarReader(cmd *cobra.Command) (*bytes.Reader, error)

GetTarReader creates tarReader for args in function BuildImage

Jump to

Keyboard shortcuts

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