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/config.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/config.go')
-rw-r--r-- | vendor/github.com/projectatomic/buildah/config.go | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/vendor/github.com/projectatomic/buildah/config.go b/vendor/github.com/projectatomic/buildah/config.go index c5fabdec6..3d67895da 100644 --- a/vendor/github.com/projectatomic/buildah/config.go +++ b/vendor/github.com/projectatomic/buildah/config.go @@ -331,6 +331,24 @@ func (b *Builder) SetUser(spec string) { b.Docker.Config.User = spec } +// OnBuild returns the OnBuild value from the container. +func (b *Builder) OnBuild() []string { + return copyStringSlice(b.Docker.Config.OnBuild) +} + +// ClearOnBuild removes all values from the OnBuild structure +func (b *Builder) ClearOnBuild() { + b.Docker.Config.OnBuild = []string{} +} + +// SetOnBuild sets a trigger instruction to be executed when the image is used +// as the base of another image. +// Note: this setting is not present in the OCIv1 image format, so it is +// discarded when writing images using OCIv1 formats. +func (b *Builder) SetOnBuild(onBuild string) { + b.Docker.Config.OnBuild = append(b.Docker.Config.OnBuild, onBuild) +} + // WorkDir returns the default working directory for running commands in the // container, or in a container built using an image built from this container. func (b *Builder) WorkDir() string { @@ -348,7 +366,7 @@ func (b *Builder) SetWorkDir(there string) { // Shell returns the default shell for running commands in the // container, or in a container built using an image built from this container. func (b *Builder) Shell() []string { - return b.Docker.Config.Shell + return copyStringSlice(b.Docker.Config.Shell) } // SetShell sets the default shell for running @@ -357,7 +375,7 @@ func (b *Builder) Shell() []string { // Note: this setting is not present in the OCIv1 image format, so it is // discarded when writing images using OCIv1 formats. func (b *Builder) SetShell(shell []string) { - b.Docker.Config.Shell = shell + b.Docker.Config.Shell = copyStringSlice(shell) } // Env returns a list of key-value pairs to be set when running commands in the |