summaryrefslogtreecommitdiff
path: root/vendor/github.com/projectatomic/buildah/imagebuildah/build.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/projectatomic/buildah/imagebuildah/build.go')
-rw-r--r--vendor/github.com/projectatomic/buildah/imagebuildah/build.go8
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)