1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-09-15 18:57:01 +00:00

extract the docker NewClientWithOpts, and add connectionhelper for DOCKER_HOST set to ssh://remote (#207)

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>

Co-authored-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
Sven Dowideit 2020-05-04 14:15:42 +10:00 committed by GitHub
parent a09b46b898
commit dea1ed5769
5 changed files with 38 additions and 15 deletions

View file

@ -6,7 +6,6 @@ import (
"strings"
"github.com/docker/docker/api/types"
"github.com/docker/docker/client"
"github.com/nektos/act/pkg/common"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
@ -48,11 +47,10 @@ func NewDockerPullExecutor(input NewDockerPullExecutorInput) common.Executor {
imageRef := cleanImage(input.Image)
logger.Debugf("pulling image '%v'", imageRef)
cli, err := client.NewClientWithOpts(client.FromEnv)
cli, err := GetDockerClient(ctx)
if err != nil {
return err
}
cli.NegotiateAPIVersion(ctx)
reader, err := cli.ImagePull(ctx, imageRef, types.ImagePullOptions{})
_ = logDockerResponse(logger, reader, err != nil)