Skip to content

Commit 6f8fb9e

Browse files
committed
add WithImageName container opt
Signed-off-by: Evan Hazlett <[email protected]>
1 parent dfd76b3 commit 6f8fb9e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

container_opts.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ func WithImage(i Image) NewContainerOpts {
7878
}
7979
}
8080

81+
// WithImageName allows setting the image name as the base for the container
82+
func WithImageName(n string) NewContainerOpts {
83+
return func(ctx context.Context, _ *Client, c *containers.Container) error {
84+
c.Image = n
85+
return nil
86+
}
87+
}
88+
8189
// WithContainerLabels adds the provided labels to the container
8290
func WithContainerLabels(labels map[string]string) NewContainerOpts {
8391
return func(_ context.Context, _ *Client, c *containers.Container) error {

0 commit comments

Comments
 (0)