Skip to content

Commit f617108

Browse files
author
OpenShift Bot
authored
Merge pull request #13235 from bparees/dockerbuild_networkmode
Merged by openshift-bot
2 parents bd2a18e + b637338 commit f617108

File tree

228 files changed

+23958
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

228 files changed

+23958
-2
lines changed

pkg/build/Godeps/Godeps.json

+158
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/build/Godeps/Readme

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/build/builder/cmd/builder.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
bld "github.com/openshift/origin/pkg/build/builder"
2525
"github.com/openshift/origin/pkg/build/builder/cmd/scmauth"
2626
"github.com/openshift/origin/pkg/client"
27-
dockerutil "github.com/openshift/origin/pkg/cmd/util/docker"
2827
"github.com/openshift/origin/pkg/generate/git"
2928
"github.com/openshift/origin/pkg/version"
3029
)
@@ -73,7 +72,7 @@ func newBuilderConfigFromEnvironment(out io.Writer) (*builderConfig, error) {
7372

7473
// dockerClient and dockerEndpoint (DOCKER_HOST)
7574
// usually not set, defaults to docker socket
76-
cfg.dockerClient, cfg.dockerEndpoint, err = dockerutil.NewHelper().GetClient()
75+
cfg.dockerClient, cfg.dockerEndpoint, err = bld.GetDockerClient()
7776
if err != nil {
7877
return nil, fmt.Errorf("no Docker configuration defined: %v", err)
7978
}

pkg/build/builder/docker.go

+1
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ func (d *DockerBuilder) dockerBuild(dir string, tag string, secrets []api.Secret
354354
NoCache: noCache,
355355
Pull: forcePull,
356356
BuildArgs: buildArgs,
357+
NetworkMode: string(getDockerNetworkMode()),
357358
}
358359

359360
if d.cgLimits != nil {

pkg/build/builder/dockerutil.go

+12
Original file line numberDiff line numberDiff line change
@@ -362,3 +362,15 @@ func newDigestWriter() *digestWriter {
362362
})
363363
return &dw
364364
}
365+
366+
// GetDockerClient returns a valid Docker client, the address of the client, or an error
367+
// if the client couldn't be created.
368+
func GetDockerClient() (client *docker.Client, endpoint string, err error) {
369+
client, err = docker.NewClientFromEnv()
370+
if len(os.Getenv("DOCKER_HOST")) > 0 {
371+
endpoint = os.Getenv("DOCKER_HOST")
372+
} else {
373+
endpoint = "unix:///var/run/docker.sock"
374+
}
375+
return
376+
}

pkg/build/vendor/github.com/Nvveen/Gotty/LICENSE

+26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/build/vendor/github.com/Nvveen/Gotty/README

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/build/vendor/github.com/Nvveen/Gotty/TODO

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)