Skip to content

Commit a46e7ef

Browse files
authored
Merge pull request #72 from drone-plugins/CI-18459
adding harness proxy vars
2 parents a093e18 + 4bf18ca commit a46e7ef

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

buildx.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package docker
22

33
import (
44
"fmt"
5+
"os"
56
"os/exec"
67
"strings"
78
)
@@ -23,6 +24,15 @@ func cmdSetupBuildx(builder Builder, driverOpts []string) *exec.Cmd {
2324
for _, opt := range driverOpts {
2425
args = append(args, "--driver-opt", opt)
2526
}
27+
if harnessHttpProxy := os.Getenv("HARNESS_HTTP_PROXY"); harnessHttpProxy != "" {
28+
args = append(args, "--driver-opt", fmt.Sprintf("env.http_proxy=%s", harnessHttpProxy))
29+
30+
if harnessHttpsProxy := os.Getenv("HARNESS_HTTPS_PROXY"); harnessHttpsProxy != "" {
31+
args = append(args, "--driver-opt", fmt.Sprintf("env.https_proxy=%s", harnessHttpsProxy))
32+
}
33+
34+
args = append(args, "--driver-opt", "network=host")
35+
}
2636
if builder.RemoteConn != "" && builder.Driver == remoteDriver {
2737
args = append(args, builder.RemoteConn)
2838
}

0 commit comments

Comments
 (0)