mirror of https://github.com/docker/docs.git
Merge pull request #4674 from vbatts/vbatts-graphdriver_build_tags
graphdriver: build tags
This commit is contained in:
commit
f14c0866ec
|
@ -157,6 +157,18 @@ AppArmor, you will need to set `DOCKER_BUILDTAGS` as follows:
|
||||||
export DOCKER_BUILDTAGS='apparmor'
|
export DOCKER_BUILDTAGS='apparmor'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
There are build tags for disabling graphdrivers as well. By default, support
|
||||||
|
for all graphdrivers are built in.
|
||||||
|
|
||||||
|
To disable devicemapper
|
||||||
|
```bash
|
||||||
|
export DOCKER_BUILDTAGS='exclude_graphdriver_devicemapper'
|
||||||
|
```
|
||||||
|
To disable aufs
|
||||||
|
```bash
|
||||||
|
export DOCKER_BUILDTAGS='exclude_graphdriver_aufs'
|
||||||
|
```
|
||||||
|
|
||||||
### Static Daemon
|
### Static Daemon
|
||||||
|
|
||||||
If it is feasible within the constraints of your distribution, you should
|
If it is feasible within the constraints of your distribution, you should
|
||||||
|
|
|
@ -16,9 +16,7 @@ import (
|
||||||
"github.com/dotcloud/docker/runtime/execdriver/execdrivers"
|
"github.com/dotcloud/docker/runtime/execdriver/execdrivers"
|
||||||
"github.com/dotcloud/docker/runtime/execdriver/lxc"
|
"github.com/dotcloud/docker/runtime/execdriver/lxc"
|
||||||
"github.com/dotcloud/docker/runtime/graphdriver"
|
"github.com/dotcloud/docker/runtime/graphdriver"
|
||||||
"github.com/dotcloud/docker/runtime/graphdriver/aufs"
|
|
||||||
_ "github.com/dotcloud/docker/runtime/graphdriver/btrfs"
|
_ "github.com/dotcloud/docker/runtime/graphdriver/btrfs"
|
||||||
_ "github.com/dotcloud/docker/runtime/graphdriver/devmapper"
|
|
||||||
_ "github.com/dotcloud/docker/runtime/graphdriver/vfs"
|
_ "github.com/dotcloud/docker/runtime/graphdriver/vfs"
|
||||||
_ "github.com/dotcloud/docker/runtime/networkdriver/lxc"
|
_ "github.com/dotcloud/docker/runtime/networkdriver/lxc"
|
||||||
"github.com/dotcloud/docker/runtime/networkdriver/portallocator"
|
"github.com/dotcloud/docker/runtime/networkdriver/portallocator"
|
||||||
|
@ -652,11 +650,9 @@ func NewRuntimeFromDirectory(config *daemonconfig.Config, eng *engine.Engine) (*
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if ad, ok := driver.(*aufs.Driver); ok {
|
// Migrate the container if it is aufs and aufs is enabled
|
||||||
utils.Debugf("Migrating existing containers")
|
if err = migrateIfAufs(driver, config.Root); err != nil {
|
||||||
if err := ad.Migrate(config.Root, graph.SetupInitLayer); err != nil {
|
return nil, err
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.Debugf("Creating images graph")
|
utils.Debugf("Creating images graph")
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
// +build !exclude_graphdriver_aufs
|
||||||
|
|
||||||
|
package runtime
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/dotcloud/docker/graph"
|
||||||
|
"github.com/dotcloud/docker/runtime/graphdriver"
|
||||||
|
"github.com/dotcloud/docker/runtime/graphdriver/aufs"
|
||||||
|
"github.com/dotcloud/docker/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Given the graphdriver ad, if it is aufs, then migrate it.
|
||||||
|
// If aufs driver is not built, this func is a noop.
|
||||||
|
func migrateIfAufs(driver graphdriver.Driver, root string) error {
|
||||||
|
if ad, ok := driver.(*aufs.Driver); ok {
|
||||||
|
utils.Debugf("Migrating existing containers")
|
||||||
|
if err := ad.Migrate(root, graph.SetupInitLayer); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
// +build !exclude_graphdriver_devicemapper
|
||||||
|
|
||||||
|
package runtime
|
||||||
|
|
||||||
|
import (
|
||||||
|
_ "github.com/dotcloud/docker/runtime/graphdriver/devmapper"
|
||||||
|
)
|
|
@ -0,0 +1,11 @@
|
||||||
|
// +build exclude_graphdriver_aufs
|
||||||
|
|
||||||
|
package runtime
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/dotcloud/docker/runtime/graphdriver"
|
||||||
|
)
|
||||||
|
|
||||||
|
func migrateIfAufs(driver graphdriver.Driver, root string) error {
|
||||||
|
return nil
|
||||||
|
}
|
Loading…
Reference in New Issue