diff options
author | umohnani8 <umohnani@redhat.com> | 2018-05-01 13:25:30 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-05-01 20:23:45 +0000 |
commit | e98ad5751d12b6ef052803b30fd397101952294e (patch) | |
tree | 9e6c0ab61205f1e26c417f5ebfdb393268f94c6a /vendor/github.com/projectatomic/buildah/commit.go | |
parent | 7a0a8552cb4af7af6fc6fb458fd41776f57f543c (diff) | |
download | podman-e98ad5751d12b6ef052803b30fd397101952294e.tar.gz podman-e98ad5751d12b6ef052803b30fd397101952294e.tar.bz2 podman-e98ad5751d12b6ef052803b30fd397101952294e.zip |
Vendor in latest buildah
Adds in --iidfile flag to podman build.
Signed-off-by: umohnani8 <umohnani@redhat.com>
Closes: #707
Approved by: mheon
Diffstat (limited to 'vendor/github.com/projectatomic/buildah/commit.go')
-rw-r--r-- | vendor/github.com/projectatomic/buildah/commit.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/vendor/github.com/projectatomic/buildah/commit.go b/vendor/github.com/projectatomic/buildah/commit.go index a5b8aaf40..d752473fa 100644 --- a/vendor/github.com/projectatomic/buildah/commit.go +++ b/vendor/github.com/projectatomic/buildah/commit.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "io" + "io/ioutil" "time" cp "github.com/containers/image/copy" @@ -46,6 +47,8 @@ type CommitOptions struct { // github.com/containers/image/types SystemContext to hold credentials // and other authentication/authorization information. SystemContext *types.SystemContext + // IIDFile tells the builder to write the image ID to the specified file + IIDFile string } // PushOptions can be used to alter how an image is copied somewhere. @@ -121,7 +124,13 @@ func (b *Builder) Commit(ctx context.Context, dest types.ImageReference, options img, err := is.Transport.GetStoreImage(b.store, dest) if err == nil { - fmt.Printf("%s\n", img.ID) + if options.IIDFile != "" { + if err := ioutil.WriteFile(options.IIDFile, []byte(img.ID), 0644); err != nil { + return errors.Wrapf(err, "failed to write Image ID File %q", options.IIDFile) + } + } else { + fmt.Printf("%s\n", img.ID) + } } return nil } |