Don't copy over volumes that were previously host volumes, and are now container volumes.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
parent
fbe8484377
commit
24e71db345
2 changed files with 29 additions and 0 deletions
|
|
@ -917,6 +917,10 @@ def get_container_data_volumes(container, volumes_option):
|
|||
if not mount:
|
||||
continue
|
||||
|
||||
# Volume was previously a host volume, now it's a container volume
|
||||
if not mount.get('Name'):
|
||||
continue
|
||||
|
||||
# Copy existing volume from old container
|
||||
volume = volume._replace(external=mount['Source'])
|
||||
volumes.append(volume)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue