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:
@@ -5,17 +5,15 @@ import (
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
"github.com/docker/docker/client"
|
||||
)
|
||||
|
||||
// ImageExistsLocally returns a boolean indicating if an image with the
|
||||
// requested name (and tag) exist in the local docker image store
|
||||
func ImageExistsLocally(ctx context.Context, imageName string) (bool, error) {
|
||||
cli, err := client.NewClientWithOpts(client.FromEnv)
|
||||
cli, err := GetDockerClient(ctx)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
cli.NegotiateAPIVersion(ctx)
|
||||
|
||||
filters := filters.NewArgs()
|
||||
filters.Add("reference", imageName)
|
||||
|
Reference in New Issue
Block a user