code: func (i *ImageService) CreateLayer(container *container.Container, initFunc layer.MountInit) (layer.RWLayer, error) {
  	var layerID layer.ChainID
  	if container.ImageID != "" {
  		img, err := i.imageStore.Get(container.ImageID)
  		if err != nil {
  			return nil, err
  		}
  		layerID = img.RootFS.ChainID()
  	}
  
  	rwLayerOpts := &layer.CreateRWLayerOpts{
  		MountLabel: container.MountLabel,
  		InitFunc:   initFunc,
  		StorageOpt: container.HostConfig.StorageOpt,
  	}
  
  	// Indexing by OS is safe here as validation of OS has already been performed in create() (the only
  	// caller), and guaranteed non-nil
  	return i.layerStores[container.OS].CreateRWLayer(container.ID, layerID, rwLayerOpts)
  }
docs: // CreateLayer creates a filesystem layer for a container.
  // called from create.go
  // TODO: accept an opt struct instead of container?