diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2018-05-31 12:38:41 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2018-06-01 10:08:56 -0400 |
commit | 29c831f9d6abf8d650bc7feb63a1e60876238504 (patch) | |
tree | 4a75e2f9fe83d9296c02509e67b74305bf927392 /vendor/github.com/projectatomic/buildah/imagebuildah | |
parent | ff3b46e769bc9a064ee8f45b9dbff8795d94bb7a (diff) | |
download | podman-29c831f9d6abf8d650bc7feb63a1e60876238504.tar.gz podman-29c831f9d6abf8d650bc7feb63a1e60876238504.tar.bz2 podman-29c831f9d6abf8d650bc7feb63a1e60876238504.zip |
Add OnBuild support for podman build
Only supported for docker formated images. OCI Does not support this flag.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'vendor/github.com/projectatomic/buildah/imagebuildah')
-rw-r--r-- | vendor/github.com/projectatomic/buildah/imagebuildah/build.go | 8 | ||||
-rw-r--r-- | vendor/github.com/projectatomic/buildah/imagebuildah/chroot_symlink.go | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/vendor/github.com/projectatomic/buildah/imagebuildah/build.go b/vendor/github.com/projectatomic/buildah/imagebuildah/build.go index a2e2912e3..f3d28510a 100644 --- a/vendor/github.com/projectatomic/buildah/imagebuildah/build.go +++ b/vendor/github.com/projectatomic/buildah/imagebuildah/build.go @@ -138,6 +138,8 @@ type BuildOptions struct { Labels []string // Annotation metadata for an image Annotations []string + // OnBuild commands to be run by images based on this image + OnBuild []string } // Executor is a buildah-based implementation of the imagebuilder.Executor @@ -183,6 +185,7 @@ type Executor struct { squash bool labels []string annotations []string + onbuild []string } // withName creates a new child executor that will be used whenever a COPY statement uses --from=NAME. @@ -598,6 +601,7 @@ func (b *Executor) Prepare(ctx context.Context, ib *imagebuilder.Builder, node * Labels: builder.Labels(), Shell: builder.Shell(), StopSignal: builder.StopSignal(), + OnBuild: builder.OnBuild(), } var rootfs *docker.RootFS if builder.Docker.RootFS != nil { @@ -714,6 +718,10 @@ func (b *Executor) Commit(ctx context.Context, ib *imagebuilder.Builder) (err er for v := range config.Volumes { b.builder.AddVolume(v) } + b.builder.ClearOnBuild() + for _, onBuildSpec := range config.OnBuild { + b.builder.SetOnBuild(onBuildSpec) + } b.builder.SetWorkDir(config.WorkingDir) b.builder.SetEntrypoint(config.Entrypoint) b.builder.SetShell(config.Shell) diff --git a/vendor/github.com/projectatomic/buildah/imagebuildah/chroot_symlink.go b/vendor/github.com/projectatomic/buildah/imagebuildah/chroot_symlink.go index b2452b61c..f1fec7f70 100644 --- a/vendor/github.com/projectatomic/buildah/imagebuildah/chroot_symlink.go +++ b/vendor/github.com/projectatomic/buildah/imagebuildah/chroot_symlink.go @@ -37,7 +37,7 @@ func resolveChrootedSymlinks() { os.Exit(1) } - // Our second paramter is the path name to evaluate for symbolic links + // Our second parameter is the path name to evaluate for symbolic links symLink, err := getSymbolicLink(flag.Arg(0), flag.Arg(1)) if err != nil { fmt.Fprintf(os.Stderr, "error getting symbolic links: %v\n", err) |