diff options
author | Tonis Tiigi <tonistiigi@gmail.com> | 2015-11-18 14:20:54 -0800 |
---|---|---|
committer | Aaron Lehmann <aaron.lehmann@docker.com> | 2015-11-24 09:40:25 -0800 |
commit | 4352da7803d182a6013a5238ce20a7c749db979a (patch) | |
tree | 172450cae09bf4bb8633b5062a896214ca9ac9b3 /daemon/container_windows.go | |
parent | 5fc0e1f324b05ce8cc7536cd807995c629e0843d (diff) | |
download | docker-4352da7803d182a6013a5238ce20a7c749db979a.tar.gz |
Update daemon and docker core to use new content addressable storage
Add distribution package for managing pulls and pushes. This is based on
the old code in the graph package, with major changes to work with the
new image/layer model.
Add v1 migration code.
Update registry, api/*, and daemon packages to use the reference
package's types where applicable.
Update daemon package to use image/layer/tag stores instead of the graph
package
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Diffstat (limited to 'daemon/container_windows.go')
-rw-r--r-- | daemon/container_windows.go | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/daemon/container_windows.go b/daemon/container_windows.go index 5400f12f45..9563f0d262 100644 --- a/daemon/container_windows.go +++ b/daemon/container_windows.go @@ -7,6 +7,7 @@ import ( "github.com/docker/docker/daemon/execdriver" derr "github.com/docker/docker/errors" + "github.com/docker/docker/layer" "github.com/docker/docker/volume" "github.com/docker/libnetwork" ) @@ -98,22 +99,25 @@ func (daemon *Daemon) populateCommand(c *Container, env []string) error { processConfig.Env = env var layerPaths []string - img, err := daemon.graph.Get(c.ImageID) + img, err := daemon.imageStore.Get(c.ImageID) if err != nil { return derr.ErrorCodeGetGraph.WithArgs(c.ImageID, err) } - for i := img; i != nil && err == nil; i, err = daemon.graph.GetParent(i) { - lp, err := daemon.driver.Get(i.ID, "") - if err != nil { - return derr.ErrorCodeGetLayer.WithArgs(daemon.driver.String(), i.ID, err) - } - layerPaths = append(layerPaths, lp) - err = daemon.driver.Put(i.ID) - if err != nil { - return derr.ErrorCodePutLayer.WithArgs(daemon.driver.String(), i.ID, err) + + if img.RootFS != nil && img.RootFS.Type == "layers+base" { + max := len(img.RootFS.DiffIDs) + for i := 0; i <= max; i++ { + img.RootFS.DiffIDs = img.RootFS.DiffIDs[:i] + path, err := layer.GetLayerPath(daemon.layerStore, img.RootFS.ChainID()) + if err != nil { + return derr.ErrorCodeGetLayer.WithArgs(err) + } + // Reverse order, expecting parent most first + layerPaths = append([]string{path}, layerPaths...) } } - m, err := daemon.driver.GetMetadata(c.ID) + + m, err := layer.RWLayerMetadata(daemon.layerStore, c.ID) if err != nil { return derr.ErrorCodeGetLayerMetadata.WithArgs(err) } |