Don't pass volumes_from to create_container

Don't pass the volumes_from argument to the Docker create_container method.

If the volumes_from argument is passed to the create_container method, Docker
raises the following exception:

    docker.errors.DockerException: 'volumes_from' parameter has no effect on
    create_container(). It has been moved to start()
This commit is contained in:
Lorin Hochstein 2014-12-27 22:05:55 -05:00 committed by Matt Clay
parent 264a16d822
commit 09e10ea031

View file

@ -750,6 +750,7 @@ class DockerManager(object):
'stdin_open': self.module.params.get('stdin_open'),
'tty': self.module.params.get('tty'),
'volumes_from': self.module.params.get('volumes_from'),
'dns': self.module.params.get('dns'),
}
if docker.utils.compare_version('1.10', self.client.version()['ApiVersion']) >= 0:
params['volumes_from'] = ""
@ -757,6 +758,11 @@ class DockerManager(object):
if params['volumes_from'] is not None:
self.ensure_capability('volumes_from')
extra_params = {}
if self.module.params.get('insecure_registry'):
if self.ensure_capability('insecure_registry', fail=False):
extra_params['insecure_registry'] = self.module.params.get('insecure_registry')
def do_create(count, params):
results = []
for _ in range(count):