diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2018-06-01 12:59:47 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-01 12:59:47 -0400 |
commit | 3c63a48bb8c1bdff688ce5b6c9c6e3079370e603 (patch) | |
tree | d098f85f80fb364e0d8b082ecd1f898cfde2c186 /vendor/github.com/projectatomic/buildah/imagebuildah/build.go | |
parent | 10d440a1c898aac84198c9c34d48d0cea9085f68 (diff) | |
parent | 29c831f9d6abf8d650bc7feb63a1e60876238504 (diff) | |
download | podman-3c63a48bb8c1bdff688ce5b6c9c6e3079370e603.tar.gz podman-3c63a48bb8c1bdff688ce5b6c9c6e3079370e603.tar.bz2 podman-3c63a48bb8c1bdff688ce5b6c9c6e3079370e603.zip |
Merge pull request #859 from rhatdan/onbuild
Add OnBuild support for podman build
Diffstat (limited to 'vendor/github.com/projectatomic/buildah/imagebuildah/build.go')
-rw-r--r-- | vendor/github.com/projectatomic/buildah/imagebuildah/build.go | 8 |
1 files changed, 8 insertions, 0 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) |