mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Move VolumeDriver to HostConfig to make containers portable.
Signed-off-by: David Calavera <david.calavera@gmail.com>
This commit is contained in:
parent
2434bd8e63
commit
6549d6517b
22 changed files with 181 additions and 78 deletions
|
@ -16,7 +16,7 @@ import (
|
|||
)
|
||||
|
||||
// createContainerPlatformSpecificSettings performs platform specific container create functionality
|
||||
func createContainerPlatformSpecificSettings(container *Container, config *runconfig.Config, img *image.Image) error {
|
||||
func createContainerPlatformSpecificSettings(container *Container, config *runconfig.Config, hostConfig *runconfig.HostConfig, img *image.Image) error {
|
||||
for spec := range config.Volumes {
|
||||
var (
|
||||
name, destination string
|
||||
|
@ -44,7 +44,7 @@ func createContainerPlatformSpecificSettings(container *Container, config *runco
|
|||
return fmt.Errorf("cannot mount volume over existing file, file exists %s", path)
|
||||
}
|
||||
|
||||
volumeDriver := config.VolumeDriver
|
||||
volumeDriver := hostConfig.VolumeDriver
|
||||
if destination != "" && img != nil {
|
||||
if _, ok := img.ContainerConfig.Volumes[destination]; ok {
|
||||
// check for whether bind is not specified and then set to local
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue