diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2018-06-07 01:00:07 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-06-07 17:14:02 +0000 |
commit | cf7c8295b8875ddd4fe87a4207aa302efbd90b18 (patch) | |
tree | f9358349d4574e469b72db2208a57c0f5160da91 /vendor/github.com/projectatomic/buildah/imagebuildah | |
parent | 7d6e717dd9f8fe367b64839089db859ca6bd8a83 (diff) | |
download | podman-cf7c8295b8875ddd4fe87a4207aa302efbd90b18.tar.gz podman-cf7c8295b8875ddd4fe87a4207aa302efbd90b18.tar.bz2 podman-cf7c8295b8875ddd4fe87a4207aa302efbd90b18.zip |
Vendor in latest buildah code
Use the parsing code to properly setup podman build namespaces
Fixes support for network namespace and user namespace
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Closes: #917
Approved by: rhatdan
Diffstat (limited to 'vendor/github.com/projectatomic/buildah/imagebuildah')
-rw-r--r-- | vendor/github.com/projectatomic/buildah/imagebuildah/build.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/vendor/github.com/projectatomic/buildah/imagebuildah/build.go b/vendor/github.com/projectatomic/buildah/imagebuildah/build.go index f3d28510a..ce0734a2b 100644 --- a/vendor/github.com/projectatomic/buildah/imagebuildah/build.go +++ b/vendor/github.com/projectatomic/buildah/imagebuildah/build.go @@ -16,6 +16,7 @@ import ( "github.com/containers/image/types" "github.com/containers/storage" "github.com/containers/storage/pkg/archive" + "github.com/containers/storage/pkg/ioutils" "github.com/containers/storage/pkg/stringid" "github.com/docker/docker/builder/dockerfile/parser" docker "github.com/fsouza/go-dockerclient" @@ -438,6 +439,11 @@ func (b *Executor) Run(run imagebuilder.Run, config docker.Config) error { if b.builder == nil { return errors.Errorf("no build container available") } + devNull, err := os.Open(os.DevNull) + if err != nil { + return errors.Errorf("error opening %q for reading: %v", os.DevNull, err) + } + defer devNull.Close() options := buildah.RunOptions{ Hostname: config.Hostname, Runtime: b.runtime, @@ -448,6 +454,9 @@ func (b *Executor) Run(run imagebuilder.Run, config docker.Config) error { WorkingDir: config.WorkingDir, Entrypoint: config.Entrypoint, Cmd: config.Cmd, + Stdin: devNull, + Stdout: ioutils.NopWriteCloser(b.out), + Stderr: ioutils.NopWriteCloser(b.err), Quiet: b.quiet, } if config.NetworkDisabled { @@ -463,7 +472,7 @@ func (b *Executor) Run(run imagebuilder.Run, config docker.Config) error { if err := b.volumeCacheSave(); err != nil { return err } - err := b.builder.Run(args, options) + err = b.builder.Run(args, options) if err2 := b.volumeCacheRestore(); err2 != nil { if err == nil { return err2 @@ -772,7 +781,7 @@ func (b *Executor) Commit(ctx context.Context, ib *imagebuilder.Builder) (err er return err } if options.IIDFile == "" && imgID != "" { - fmt.Printf("%s\n", imgID) + fmt.Fprintf(b.out, "%s\n", imgID) } return nil } |