Skip to content

Commit

Permalink
Merge pull request #3584 from ehazlett/with-image-name
Browse files Browse the repository at this point in the history
WithImageName container opt
  • Loading branch information
dmcgowan committed Aug 26, 2019
2 parents cde03a0 + 6f8fb9e commit d618c80
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions container_opts.go
Expand Up @@ -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 {
Expand Down

0 comments on commit d618c80

Please sign in to comment.