Skip to content

Commit

Permalink
Fix overlay test running on overlay
Browse files Browse the repository at this point in the history
Overlay tests were failing when /var/tmp was an overlay mount with a misleading message.
Now overlay tests will be skipped when attempting to be run on overlay.
Tests will now use the TMPDIR environment variable instead of only /var/tmp

Fixes #21686

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
  • Loading branch information
dmcgowan committed Apr 7, 2016
1 parent 83bc8d2 commit 824c72f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion daemon/graphdriver/graphtest/graphtest_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func getBaseLoopStats() (*syscall.Stat_t, error) {
}

func newDriver(t *testing.T, name string) *Driver {
root, err := ioutil.TempDir("/var/tmp", "docker-graphtest-")
root, err := ioutil.TempDir("", "docker-graphtest-")
if err != nil {
t.Fatal(err)
}
Expand Down
5 changes: 4 additions & 1 deletion daemon/graphdriver/overlay/overlay.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (grap
backingFs = fsName
}

// check if they are running over btrfs or aufs
// check if they are running over btrfs, aufs, zfs or overlay
switch fsMagic {
case graphdriver.FsMagicBtrfs:
logrus.Error("'overlay' is not supported over btrfs.")
Expand All @@ -131,6 +131,9 @@ func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (grap
case graphdriver.FsMagicZfs:
logrus.Error("'overlay' is not supported over zfs.")
return nil, graphdriver.ErrIncompatibleFS
case graphdriver.FsMagicOverlay:
logrus.Error("'overlay' is not supported over overlay.")

This comment has been minimized.

Copy link
@alex-berger

alex-berger May 9, 2016

Can you please elaborate why overlay over overlay does not work anymore respectively is no longer supported?
We use Docker in Docker (running the Docker Engine inside a Docker Container) with both Docker Engines using --storage-driver overlay. This used to work with Docker 1.10.3 but does not work with Docker 1.11.1.

This comment has been minimized.

Copy link
@dmcgowan

dmcgowan May 9, 2016

Author Member

The logic to check if a layer mounted changed in a way that only checked to see if the directory for a layer was the type of mount for the graph driver. This means that if you don't use a volume and attempt to run overlay inside of overlay, it will always think layers are mounted, leading to very quirky behavior. See https://github.com/docker/docker/blob/master/daemon/graphdriver/driver_linux.go#L98 for where this logic currently exists in master. It has never been recommended or supported to run Docker in Docker without running the graph directory in a volume. I have attempted to get around this as well but it has always lead to bad behavior and horrible performance.

This comment has been minimized.

Copy link
@suryagaddipati

suryagaddipati Oct 7, 2016

@dmcgowan is it possible to run dind with graph directory on overlay volume mount ?

return nil, graphdriver.ErrIncompatibleFS
}

rootUID, rootGID, err := idtools.GetRootUIDGID(uidMaps, gidMaps)
Expand Down

0 comments on commit 824c72f

Please sign in to comment.