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:
Daniel Nephin 2016-01-19 14:41:21 -05:00 committed by Aanand Prasad
commit 24e71db345
2 changed files with 29 additions and 0 deletions

View file

@ -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)