|
@@ -1,7 +1,6 @@
|
|
package daemon // import "github.com/docker/docker/daemon"
|
|
package daemon // import "github.com/docker/docker/daemon"
|
|
|
|
|
|
import (
|
|
import (
|
|
- "errors"
|
|
|
|
"fmt"
|
|
"fmt"
|
|
"io/ioutil"
|
|
"io/ioutil"
|
|
"path/filepath"
|
|
"path/filepath"
|
|
@@ -10,11 +9,11 @@ import (
|
|
|
|
|
|
containertypes "github.com/docker/docker/api/types/container"
|
|
containertypes "github.com/docker/docker/api/types/container"
|
|
"github.com/docker/docker/container"
|
|
"github.com/docker/docker/container"
|
|
- "github.com/docker/docker/layer"
|
|
|
|
"github.com/docker/docker/oci"
|
|
"github.com/docker/docker/oci"
|
|
"github.com/docker/docker/pkg/sysinfo"
|
|
"github.com/docker/docker/pkg/sysinfo"
|
|
"github.com/docker/docker/pkg/system"
|
|
"github.com/docker/docker/pkg/system"
|
|
"github.com/opencontainers/runtime-spec/specs-go"
|
|
"github.com/opencontainers/runtime-spec/specs-go"
|
|
|
|
+ "github.com/pkg/errors"
|
|
"golang.org/x/sys/windows"
|
|
"golang.org/x/sys/windows"
|
|
"golang.org/x/sys/windows/registry"
|
|
"golang.org/x/sys/windows/registry"
|
|
)
|
|
)
|
|
@@ -139,29 +138,10 @@ func (daemon *Daemon) createSpec(c *container.Container) (*specs.Spec, error) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
s.Process.User.Username = c.Config.User
|
|
s.Process.User.Username = c.Config.User
|
|
-
|
|
|
|
- // Get the layer path for each layer.
|
|
|
|
- max := len(img.RootFS.DiffIDs)
|
|
|
|
- for i := 1; i <= max; i++ {
|
|
|
|
- img.RootFS.DiffIDs = img.RootFS.DiffIDs[:i]
|
|
|
|
- if !system.IsOSSupported(img.OperatingSystem()) {
|
|
|
|
- return nil, fmt.Errorf("cannot get layerpath for ImageID %s: %s ", img.RootFS.ChainID(), system.ErrNotSupportedOperatingSystem)
|
|
|
|
- }
|
|
|
|
- layerPath, err := layer.GetLayerPath(daemon.layerStores[img.OperatingSystem()], img.RootFS.ChainID())
|
|
|
|
- if err != nil {
|
|
|
|
- return nil, fmt.Errorf("failed to get layer path from graphdriver %s for ImageID %s - %s", daemon.layerStores[img.OperatingSystem()], img.RootFS.ChainID(), err)
|
|
|
|
- }
|
|
|
|
- // Reverse order, expecting parent most first
|
|
|
|
- s.Windows.LayerFolders = append([]string{layerPath}, s.Windows.LayerFolders...)
|
|
|
|
- }
|
|
|
|
- if c.RWLayer == nil {
|
|
|
|
- return nil, errors.New("RWLayer of container " + c.ID + " is unexpectedly nil")
|
|
|
|
- }
|
|
|
|
- m, err := c.RWLayer.Metadata()
|
|
|
|
|
|
+ s.Windows.LayerFolders, err = daemon.GetLayerFolders(img, c.RWLayer)
|
|
if err != nil {
|
|
if err != nil {
|
|
- return nil, fmt.Errorf("failed to get layer metadata - %s", err)
|
|
|
|
|
|
+ return nil, errors.Wrapf(err, "container %s", c.ID)
|
|
}
|
|
}
|
|
- s.Windows.LayerFolders = append(s.Windows.LayerFolders, m["dir"])
|
|
|
|
|
|
|
|
dnsSearch := daemon.getDNSSearchSettings(c)
|
|
dnsSearch := daemon.getDNSSearchSettings(c)
|
|
|
|
|