This commit is contained in:
parent
81cbb143da
commit
4b6ff484e3
@ -6,13 +6,14 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
|
|
||||||
"github.com/docker/docker/client"
|
"github.com/docker/docker/client"
|
||||||
"github.com/wagoodman/dive/filetree"
|
"github.com/wagoodman/dive/filetree"
|
||||||
"github.com/wagoodman/dive/utils"
|
"github.com/wagoodman/dive/utils"
|
||||||
@ -201,7 +202,7 @@ func InitializeData(imageID string) ([]*Layer, []*filetree.FileTree, float64, fi
|
|||||||
|
|
||||||
// pull the image if it does not exist
|
// pull the image if it does not exist
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
dockerClient, err := client.NewClientWithOpts(client.WithVersion(dockerVersion))
|
dockerClient, err := client.NewClientWithOpts(client.WithVersion(dockerVersion), client.FromEnv)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Could not connect to the Docker daemon:" + err.Error())
|
fmt.Println("Could not connect to the Docker daemon:" + err.Error())
|
||||||
utils.Exit(1)
|
utils.Exit(1)
|
||||||
@ -334,7 +335,7 @@ func InitializeData(imageID string) ([]*Layer, []*filetree.FileTree, float64, fi
|
|||||||
|
|
||||||
func saveImage(imageID string) (string, string) {
|
func saveImage(imageID string) (string, string) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
dockerClient, err := client.NewClientWithOpts(client.WithVersion(dockerVersion))
|
dockerClient, err := client.NewClientWithOpts(client.WithVersion(dockerVersion), client.FromEnv)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Could not connect to the Docker daemon:" + err.Error())
|
fmt.Println("Could not connect to the Docker daemon:" + err.Error())
|
||||||
utils.Exit(1)
|
utils.Exit(1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user