1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

dockerd: create /var/lib/docker if it doesn't exist

This commit is contained in:
Solomon Hykes 2013-02-19 13:03:58 -08:00
parent a7e9582a53
commit 5e2f0639c6
2 changed files with 4 additions and 1 deletions

View file

@ -107,7 +107,7 @@ func NewFromDirectory(root string) (*Docker, error) {
containers: list.New(),
}
if err := os.Mkdir(docker.repository, 0700); err != nil && !os.IsExist(err) {
if err := os.MkdirAll(docker.repository, 0700); err != nil && !os.IsExist(err) {
return nil, err
}

View file

@ -27,6 +27,9 @@ func New(root string) (*Store, error) {
if err != nil {
return nil, err
}
if err := os.MkdirAll(abspath, 0700); err != nil && !os.IsExist(err) {
return nil, err
}
layers, err := NewLayerStore(path.Join(root, "layers"))
if err != nil {
return nil, err