diff options
author | Urvashi Mohnani <umohnani@redhat.com> | 2019-02-04 09:49:39 -0500 |
---|---|---|
committer | Urvashi Mohnani <umohnani@redhat.com> | 2019-02-04 13:48:37 -0500 |
commit | edf16be28dd4f6bd6ce9a60de0b0114415dc4f9a (patch) | |
tree | dcbb1dfe4ef0a9c10aacb4b2622bbc04590da9f2 /vendor | |
parent | 465e19b555abb03d465dc448b169ea1661eb8cce (diff) | |
download | podman-edf16be28dd4f6bd6ce9a60de0b0114415dc4f9a.tar.gz podman-edf16be28dd4f6bd6ce9a60de0b0114415dc4f9a.tar.bz2 podman-edf16be28dd4f6bd6ce9a60de0b0114415dc4f9a.zip |
Vendor containers/buildah
Pull in fixes to build for single and two line Dockerfiles.
Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
Diffstat (limited to 'vendor')
-rw-r--r-- | vendor/github.com/containers/buildah/imagebuildah/build.go | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/vendor/github.com/containers/buildah/imagebuildah/build.go b/vendor/github.com/containers/buildah/imagebuildah/build.go index 217bcfc79..56ab7aa57 100644 --- a/vendor/github.com/containers/buildah/imagebuildah/build.go +++ b/vendor/github.com/containers/buildah/imagebuildah/build.go @@ -1311,13 +1311,17 @@ func (b *Executor) Build(ctx context.Context, stages imagebuilder.Stages) (strin // Check if we have a one line Dockerfile making layers irrelevant // or the user told us to ignore layers. - ignoreLayers := (len(stages) < 2 && len(stages[0].Node.Children) < 2) || (!b.layers && !b.noCache) + singleLineDockerfile := (len(stages) < 2 && len(stages[0].Node.Children) < 1) + ignoreLayers := singleLineDockerfile || !b.layers && !b.noCache if ignoreLayers { imgID, ref, err := stageExecutor.Commit(ctx, stages[len(stages)-1].Builder, "") if err != nil { return "", nil, err } + if singleLineDockerfile { + b.log("COMMIT %s", ref) + } imageID = imgID imageRef = ref } @@ -1527,6 +1531,17 @@ func (b *Executor) deleteSuccessfulIntermediateCtrs() error { return lastErr } +func (b *Executor) EnsureContainerPath(path string) error { + _, err := os.Stat(filepath.Join(b.mountPoint, path)) + if err != nil && os.IsNotExist(err) { + err = os.MkdirAll(filepath.Join(b.mountPoint, path), 0755) + } + if err != nil { + return errors.Wrapf(err, "error ensuring container path %q", path) + } + return nil +} + // preprocessDockerfileContents runs CPP(1) in preprocess-only mode on the input // dockerfile content and will use ctxDir as the base include path. // |