|
96 | 96 | apiServerNames []string
|
97 | 97 | apiServerIPs []net.IP
|
98 | 98 | extraOptions pkgutil.ExtraOptionSlice
|
| 99 | + |
| 100 | + // proxyVars are variables we plumb through to the underlying container runtime |
| 101 | + proxyVars = []string{"HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY"} |
99 | 102 | )
|
100 | 103 |
|
101 | 104 | func init() {
|
@@ -265,6 +268,17 @@ func generateConfig(cmd *cobra.Command, kVersion string) (cfg.Config, error) {
|
265 | 268 | }
|
266 | 269 | }
|
267 | 270 |
|
| 271 | + // Feed Docker our host proxy environment by default, so that it can pull images |
| 272 | + if _, ok := r.(*cruntime.Docker); ok { |
| 273 | + if !cmd.Flags().Changed("docker-env") { |
| 274 | + for _, k := range proxyVars { |
| 275 | + if v := os.Getenv(k); v != "" { |
| 276 | + dockerEnv = append(dockerEnv, fmt.Sprintf("%s=%s", k, v)) |
| 277 | + } |
| 278 | + } |
| 279 | + } |
| 280 | + } |
| 281 | + |
268 | 282 | cfg := cfg.Config{
|
269 | 283 | MachineConfig: cfg.MachineConfig{
|
270 | 284 | MinikubeISO: viper.GetString(isoURL),
|
@@ -371,7 +385,7 @@ func validateNetwork(h *host.Host) string {
|
371 | 385 | console.OutStyle("connectivity", "%q IP address is %s", cfg.GetMachineName(), ip)
|
372 | 386 |
|
373 | 387 | optSeen := false
|
374 |
| - for _, k := range []string{"HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY"} { |
| 388 | + for _, k := range proxyVars { |
375 | 389 | if v := os.Getenv(k); v != "" {
|
376 | 390 | if !optSeen {
|
377 | 391 | console.OutStyle("internet", "Found network options:")
|
|
0 commit comments