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

Commit a4c7554

Browse files
committed
Support local TCP for Docker host
1 parent 7ef0b72 commit a4c7554

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

img2lambda/extract/repack_image.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ func RepackImage(imageName string, layerOutputDir string) (layers []types.Lambda
3434

3535
sys := &imgtypes.SystemContext{}
3636

37+
// Support communicating with Docker for Windows over local plain-text TCP socket
38+
dockerHost := os.Getenv("DOCKER_HOST")
39+
if dockerHost == "tcp://localhost:2375" || dockerHost == "tcp://127.0.0.1:2375" {
40+
sys.DockerDaemonHost = dockerHost
41+
}
42+
3743
ctx := context.Background()
3844

3945
cache := blobinfocache.DefaultCache(sys)

0 commit comments

Comments
 (0)