Don't require rootfs if not set on container

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-05-25 11:17:36 -07:00
parent a2b0824720
commit d0b22290ec
8 changed files with 35 additions and 29 deletions

View File

@@ -158,7 +158,7 @@ func WithRuntime(name string) NewContainerOpts {
// NewContainer will create a new container in container with the provided id
// the id must be unique within the namespace
func (c *Client) NewContainer(ctx context.Context, id string, spec *specs.Spec, opts ...NewContainerOpts) (Container, error) {
func (c *Client) NewContainer(ctx context.Context, id string, image Image, spec *specs.Spec, opts ...NewContainerOpts) (Container, error) {
data, err := json.Marshal(spec)
if err != nil {
return nil, err
@@ -170,6 +170,7 @@ func (c *Client) NewContainer(ctx context.Context, id string, spec *specs.Spec,
TypeUrl: specs.Version,
Value: data,
},
Image: image.Name(),
}
for _, o := range opts {
if err := o(ctx, c, &container); err != nil {