Skip to content
This repository was archived by the owner on Dec 2, 2020. It is now read-only.

Commit 23da2fe

Browse files
committed
Support Docker Toolbox docker daemons
Fixes #26
1 parent 4dc9f5e commit 23da2fe

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

img2lambda/extract/repack_image.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,18 @@ func RepackImage(imageName string, layerOutputDir string) (layers []types.Lambda
3535

3636
sys := &imgtypes.SystemContext{}
3737

38-
// Support communicating with Docker for Windows over local plain-text TCP socket
3938
dockerHost := os.Getenv("DOCKER_HOST")
39+
40+
// Support communicating with Docker for Windows over local plain-text TCP socket
4041
if dockerHost == "tcp://localhost:2375" || dockerHost == "tcp://127.0.0.1:2375" {
4142
sys.DockerDaemonHost = strings.Replace(dockerHost, "tcp://", "http://", -1)
4243
}
4344

45+
// Support communicating with Docker Toolbox over encrypted socket
46+
if strings.HasPrefix(dockerHost, "tcp://192.168.") && strings.HasSuffix(dockerHost, ":2376") {
47+
sys.DockerDaemonHost = strings.Replace(dockerHost, "tcp://", "https://", -1)
48+
}
49+
4450
ctx := context.Background()
4551

4652
cache := blobinfocache.DefaultCache(sys)

0 commit comments

Comments
 (0)