Documentation ¶
Index ¶
- Constants
- Variables
- func ParamsDesc() []*action.RunParamDesc
- type Runner
- func (r *Runner) Cancel(ctx context.Context, in *runner.CancelRequest)
- func (r *Runner) Connect(context.Context, *runner.ConnectRequest) error
- func (r *Runner) Log(context.Context, *runner.LogRequest) (io.ReadCloser, error)
- func (r *Runner) Run(ctx context.Context, in *runner.RunRequest, out *runner.RunResponse)
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 (*Runner) Log ¶
func (r *Runner) Log(context.Context, *runner.LogRequest) (io.ReadCloser, error)
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: 代码推送地址
Click to show internal directories.
Click to hide internal directories.