Documentation ¶
Overview ¶
Package dockerengine provides functionality to interact with the Docker server.
Package dockerengine is a generated GoMock package.
Index ¶
- Constants
- Variables
- func PlatformString(os, arch string) string
- type BuildArguments
- type Cmd
- type CmdClient
- func (c CmdClient) Build(in *BuildArguments) error
- func (c CmdClient) CheckDockerEngineRunning() error
- func (c CmdClient) GetPlatform() (os, arch string, err error)
- func (c CmdClient) IsEcrCredentialHelperEnabled(uri string) bool
- func (c CmdClient) Login(uri, username, password string) error
- func (c CmdClient) Push(uri string, tags ...string) (digest string, err error)
- type ErrDockerDaemonNotResponsive
- type MockCmd
- type MockCmdMockRecorder
Constants ¶
const ( OSLinux = "linux" OSWindows = "windows" ArchAMD64 = "amd64" ArchX86 = "x86_64" ArchARM = "arm" ArchARM64 = "arm64" )
Operating systems and architectures supported by docker.
Variables ¶
var ErrDockerCommandNotFound = errors.New("docker: command not found")
ErrDockerCommandNotFound means the docker command is not found.
Functions ¶
func PlatformString ¶ added in v1.12.0
PlatformString returns a specified of the format <os>/<arch>.
Types ¶
type BuildArguments ¶
type BuildArguments struct { URI string // Required. Location of ECR Repo. Used to generate image name in conjunction with tag. Tags []string // Optional. List of tags to apply to the image besides "latest". Dockerfile string // Required. Dockerfile to pass to `docker build` via --file flag. Context string // Optional. Build context directory to pass to `docker build`. Target string // Optional. The target build stage to pass to `docker build`. CacheFrom []string // Optional. Images to consider as cache sources to pass to `docker build` Platform string // Optional. OS/Arch to pass to `docker build`. Args map[string]string // Optional. Build args to pass via `--build-arg` flags. Equivalent to ARG directives in dockerfile. }
BuildArguments holds the arguments that can be passed while building a container.
type CmdClient ¶
type CmdClient struct {
// contains filtered or unexported fields
}
CmdClient represents the docker client to interact with the server via external commands.
func (CmdClient) Build ¶
func (c CmdClient) Build(in *BuildArguments) error
Build will run a `docker build` command for the given ecr repo URI and build arguments.
func (CmdClient) CheckDockerEngineRunning ¶
CheckDockerEngineRunning will run `docker info` command to check if the docker engine is running.
func (CmdClient) GetPlatform ¶ added in v1.12.0
GetPlatform will run the `docker version` command to get the OS/Arch.
func (CmdClient) IsEcrCredentialHelperEnabled ¶
IsEcrCredentialHelperEnabled return true if ecr-login is enabled either globally or registry level
type ErrDockerDaemonNotResponsive ¶
type ErrDockerDaemonNotResponsive struct {
// contains filtered or unexported fields
}
ErrDockerDaemonNotResponsive means the docker daemon is not responsive.
func (ErrDockerDaemonNotResponsive) Error ¶
func (e ErrDockerDaemonNotResponsive) Error() string
type MockCmd ¶
type MockCmd struct {
// contains filtered or unexported fields
}
MockCmd is a mock of Cmd interface.
func NewMockCmd ¶
func NewMockCmd(ctrl *gomock.Controller) *MockCmd
NewMockCmd creates a new mock instance.
func (*MockCmd) EXPECT ¶
func (m *MockCmd) EXPECT() *MockCmdMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockCmdMockRecorder ¶
type MockCmdMockRecorder struct {
// contains filtered or unexported fields
}
MockCmdMockRecorder is the mock recorder for MockCmd.
func (*MockCmdMockRecorder) Run ¶
func (mr *MockCmdMockRecorder) Run(name, args interface{}, options ...interface{}) *gomock.Call
Run indicates an expected call of Run.