mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge global storage options on create
Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
parent
aaee3ca6c1
commit
932ae425e8
1 changed files with 17 additions and 0 deletions
|
@ -137,6 +137,23 @@ func (daemon *Daemon) create(params types.ContainerCreateConfig, managed bool) (
|
||||||
|
|
||||||
container.HostConfig.StorageOpt = params.HostConfig.StorageOpt
|
container.HostConfig.StorageOpt = params.HostConfig.StorageOpt
|
||||||
|
|
||||||
|
// Fixes: https://github.com/moby/moby/issues/34074 and
|
||||||
|
// https://github.com/docker/for-win/issues/999.
|
||||||
|
// Merge the daemon's storage options if they aren't already present. We only
|
||||||
|
// do this on Windows as there's no effective sandbox size limit other than
|
||||||
|
// physical on Linux.
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
if container.HostConfig.StorageOpt == nil {
|
||||||
|
container.HostConfig.StorageOpt = make(map[string]string)
|
||||||
|
}
|
||||||
|
for _, v := range daemon.configStore.GraphOptions {
|
||||||
|
opt := strings.SplitN(v, "=", 2)
|
||||||
|
if _, ok := container.HostConfig.StorageOpt[opt[0]]; !ok {
|
||||||
|
container.HostConfig.StorageOpt[opt[0]] = opt[1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Set RWLayer for container after mount labels have been set
|
// Set RWLayer for container after mount labels have been set
|
||||||
if err := daemon.setRWLayer(container); err != nil {
|
if err := daemon.setRWLayer(container); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Add table
Reference in a new issue