diff --git a/image_recover_tool/image-check/daemon/config/config.go b/image_recover_tool/image-check/daemon/config/config.go index 3bac1bfdf1647cf0f7c593817f89b755f1ba75fc..e1ab0094505264966f00e078592bdb70379d4f53 100644 --- a/image_recover_tool/image-check/daemon/config/config.go +++ b/image_recover_tool/image-check/daemon/config/config.go @@ -21,6 +21,7 @@ const ( type DaemonConfig struct { Root string `json:"graph,omitempty"` GraphDriver string `json:"storage-driver,omitempty"` + StorageIsolate string `json:"storage-isolate,omitempty"` } func GetDockerRoot(dockerdConfigPath, root, driver string) (*DaemonConfig, error) { @@ -38,10 +39,17 @@ func GetDockerRoot(dockerdConfigPath, root, driver string) (*DaemonConfig, error } if fileConfig.Root != "" { dc.Root = fileConfig.Root + dc.StorageIsolate = fileConfig.Root + }else { + dc.StorageIsolate = DefaultPath } if fileConfig.GraphDriver != "" { dc.GraphDriver = fileConfig.GraphDriver } + if fileConfig.StorageIsolate != ""{ + dc.StorageIsolate = fileConfig.StorageIsolate + } + } else { logrus.Warnf("The docker configuration file not found: %s", dockerdConfigPath) } diff --git a/image_recover_tool/image-check/layer/layer_store.go b/image_recover_tool/image-check/layer/layer_store.go index 741a1dc0522d6efb29a0f23699adf4cc54b0662d..3da6ee332bfd581f03db48a9aa2bc889030c6b50 100644 --- a/image_recover_tool/image-check/layer/layer_store.go +++ b/image_recover_tool/image-check/layer/layer_store.go @@ -58,7 +58,7 @@ type roLayer struct { // NewStoreFromOptions creates a new Store instance func NewStoreFromOptions(config *config.DaemonConfig) Store { fms := NewFSMetadataStore(filepath.Join(config.Root, "image", config.GraphDriver, "layerdb")) - driver := NewDirver(filepath.Join(config.Root, config.GraphDriver)) + driver := NewDirver(filepath.Join(config.StorageIsolate, config.GraphDriver)) return NewStoreFromGraphDriver(fms, driver, config) }