func pushImage(ctx *context.ExecuteContext, t *Task, tag string) error { repo, err := parseAuthRepo(t.config.Image) if err != nil { return err } return Stream(os.Stdout, func(out io.Writer) error { return ctx.Client.PushImage(docker.PushImageOptions{ Name: tag, OutputStream: out, RawJSONStream: true, // TODO: timeout }, ctx.GetAuthConfig(repo)) }) }
func pullImage(ctx *context.ExecuteContext, t *Task, imageTag string) error { registry, err := parseAuthRepo(t.config.Image) if err != nil { return err } repo, tag := docker.ParseRepositoryTag(imageTag) return Stream(os.Stdout, func(out io.Writer) error { return ctx.Client.PullImage(docker.PullImageOptions{ Repository: repo, Tag: tag, OutputStream: out, RawJSONStream: true, // TODO: timeout }, ctx.GetAuthConfig(registry)) }) }