|
@@ -720,16 +720,18 @@ func sysctlExists(s string) bool {
|
|
|
// WithCommonOptions sets common docker options
|
|
|
func WithCommonOptions(daemon *Daemon, c *container.Container) coci.SpecOpts {
|
|
|
return func(ctx context.Context, _ coci.Client, _ *containers.Container, s *coci.Spec) error {
|
|
|
- if c.BaseFS == nil {
|
|
|
+ if c.BaseFS == nil && !daemon.usesSnapshotter() {
|
|
|
return errors.New("populateCommonSpec: BaseFS of container " + c.ID + " is unexpectedly nil")
|
|
|
}
|
|
|
linkedEnv, err := daemon.setupLinkedContainers(c)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- s.Root = &specs.Root{
|
|
|
- Path: c.BaseFS.Path(),
|
|
|
- Readonly: c.HostConfig.ReadonlyRootfs,
|
|
|
+ if !daemon.usesSnapshotter() {
|
|
|
+ s.Root = &specs.Root{
|
|
|
+ Path: c.BaseFS.Path(),
|
|
|
+ Readonly: c.HostConfig.ReadonlyRootfs,
|
|
|
+ }
|
|
|
}
|
|
|
if err := c.SetupWorkingDirectory(daemon.idMapping.RootPair()); err != nil {
|
|
|
return err
|