Skip to content

Commit

Permalink
Use github.com/docker/docker/pkg/fileutils
Browse files Browse the repository at this point in the history
  • Loading branch information
yuuki committed Dec 7, 2015
1 parent b1bde55 commit 95c1896
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions commands/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"syscall"

"github.com/codegangsta/cli"
"github.com/docker/docker/pkg/fileutils"
"github.com/docker/docker/pkg/mount"
"github.com/hashicorp/errwrap"

Expand Down Expand Up @@ -186,8 +187,8 @@ func bindMount(bindDir string, rootDir string, readonly bool) error {

containerDir := fp.Join(rootDir, destDir)

if err := os.MkdirAll(containerDir, os.FileMode(0755)); err != nil {
return errwrap.Wrapf(fmt.Sprintf("Failed to mkdir %s: {{err}}", containerDir), err)
if err := fileutils.CreateIfNotExists(containerDir, true); err != nil { // mkdir -p
return errwrap.Wrapf(fmt.Sprintf("Failed to create directory: %s: {{err}}", containerDir), err)
}

ok, err = osutil.IsDirEmpty(containerDir)
Expand Down

0 comments on commit 95c1896

Please sign in to comment.