Merge pull request #3584 from ehazlett/with-image-name

WithImageName container opt
This commit is contained in:
Derek McGowan 2019-08-26 13:42:47 -07:00 committed by GitHub
commit d618c80077
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,6 +78,14 @@ func WithImage(i Image) NewContainerOpts {
}
}
// WithImageName allows setting the image name as the base for the container
func WithImageName(n string) NewContainerOpts {
return func(ctx context.Context, _ *Client, c *containers.Container) error {
c.Image = n
return nil
}
}
// WithContainerLabels adds the provided labels to the container
func WithContainerLabels(labels map[string]string) NewContainerOpts {
return func(_ context.Context, _ *Client, c *containers.Container) error {