mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-06 07:10:28 +00:00
extract the docker NewClientWithOpts, and add connectionhelper for DOCKER_HOST set to ssh://remote (#207)
Signed-off-by: Sven Dowideit <[email protected]> Co-authored-by: Casey Lee <[email protected]>
This commit is contained in:
1 parent
ef9fab9fad
commit
6196436f70
7 files changed
+42
-15
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user