docker

package
v0.0.0-...-c01aa29 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IMAGE_URL_KEY     = "IMAGE_URL"
	IMAGE_CMD_KEY     = "IMAGE_CMD"
	IMAGE_VERSION_KEY = "IMAGE_VERSION"
)
View Source
const (
	CONTAINER_ID_KEY   = "container_id"
	CONTAINER_WARN_KEY = "container_warn"
)

Variables

View Source
var (
	IMAGE_URL_KEY_DESC = &action.RunParamDesc{
		KeyName:   IMAGE_URL_KEY,
		KeyDesc:   "镜像地址",
		Required:  true,
		ValueDesc: "镜像仓库地址, 比如busybox, 如果是私有仓库请配置认证信息",
	}
	IMAGE_VERSION_KEY_DESC = &action.RunParamDesc{
		KeyName:   IMAGE_VERSION_KEY,
		KeyDesc:   "镜像版本",
		Required:  false,
		ValueDesc: "镜像对应的Tag, 比如latest",
	}
	IMAGE_CMD_KEY_DESC = &action.RunParamDesc{
		KeyName:   IMAGE_CMD_KEY,
		KeyDesc:   "执行命令",
		Required:  true,
		ValueDesc: "如果是多部分请用逗号分隔, 比如 sleep,10",
	}
)

Functions

func ParamsDesc

func ParamsDesc() []*action.RunParamDesc

Types

type Runner

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

Docker官方SDK使用说明: https://docs.docker.com/engine/api/sdk/examples/ Docker官方API使用说明: https://docs.docker.com/engine/api/v1.41/

func NewRunner

func NewRunner() (*Runner, error)

func (*Runner) Cancel

func (r *Runner) Cancel(ctx context.Context, in *runner.CancelRequest)

func (*Runner) Connect

func (*Runner) Log

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, in *runner.RunRequest, out *runner.RunResponse)

ContainerCreate参数说明: https://docs.docker.com/engine/api/v1.41/#operation/ContainerCreate Runner Params:

IMAGE_URL: 镜像URL, 比如: docker-build
IMAGE_PULL_SECRET: 拉起镜像的凭证
IMAGE_PUSH_SECRET: 推送镜像的凭证

Run Params:

IMAGE_VERSION: 镜像版本 比如: v1
GIT_SSH_URL: 代码仓库地址, 比如: git@gitee.com:infraboard/keyauth.git
IMAGE_PUSH_URL: 代码推送地址

Jump to

Keyboard shortcuts

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